#avr | Logs for 2015-03-01

Back
[01:29:21] <Flipp_> err, why is it when I try to program a 2560's fuses to hfuse:w:0xDE:m and efuse:w:0xFA:m, avrdude reports fuses as (H:FA, E:DE, L:FF)?
[01:29:43] <Flipp_> looks like H and E are switched...?
[01:32:35] <Flipp_> ah, nm, looks like a typo with the avrdude binary I'm using (see avrdude's main.c chane at revision 1247)
[01:33:08] <Flipp_> *change
[02:09:03] <xa0z> rue_shop3, https://github.com/jnwatts/USBPass
[02:09:07] <xa0z> Not that I can find.
[02:10:52] <rue_shop3> huh
[02:11:02] <rue_shop3> that would be a good bug to make sure is filed
[02:22:59] <xa0z> I can not get this damn thing to build.
[02:23:39] <xa0z> I run 'make' and it floods me with many lines about needing an operator, missing dependancy operator, etc.
[02:28:38] <rue_shop3> why are you not using a pre-compiled?
[02:28:53] <xa0z> The USBPass doesn't come precompiled that I can find.
[02:29:01] <rue_shop3> you should know that the ONLY person who can compile ANY software package is the developer
[02:29:04] <rue_shop3> ah
[06:53:04] <Lambda_Aurigae> http://monograph.io/james/m-mtm
[08:12:26] <theBear> 100% science eh ? that sounds positive
[08:22:34] <Lambda_Aurigae> yeah.
[09:54:09] <Jan-> has anyone here ever created an ammeter with an AVR?
[09:54:56] <Jan-> I'm not sure if it'd be a good idea to try and read a current shunt with the a-to-d converter directly, or whether I should plan to have some analog amplification.
[10:24:36] <RikusW> Hi Jan-
[10:25:49] <RikusW> if one end of the shunt is ground you could read directly provided the AVR can provide the amplification you need
[10:26:53] <RikusW> or use a differential amp, possibly one in the AVR
[10:27:25] <RikusW> if it is HV AC you'll need isolation
[10:29:06] <Jan-> it's just 12V DC
[10:30:13] <Jan-> the question was really whether we need an op-amp on the board to biggerise the signal
[10:30:24] <Jan-> but I found some interesting hall effect current sensors on ebay which might also be fine.
[10:45:24] <Fleck> Jan-: yes, I have many times :D
[10:56:22] <Jan-> did it work?
[11:27:26] <Flipp_> any clue why no matter what combination I set the BOOTRST, BOOTSZ0, and BOOTSZ1 fuses to it still jumps to the bootloader at 0x1E000? (mega2560)
[11:30:39] <Tom_itx> is the code compiled to load there?
[11:30:42] <Tom_itx> in the makefile
[11:31:09] <Flipp_> yeah. I've dumped the chip and everything except 0x1E000 to the end is 0xFF (erased)
[11:31:29] <Flipp_> but those fuses control the start address of the chip, right?
[11:31:58] <Tom_itx> i haven't done my own but i've saved a bootloader and changed the fuses back to a normal avr and back to a bootloader fuse setting with no problems
[11:32:01] <Tom_itx> yes
[11:32:56] <Tom_itx> it may matter what order you do things in, i'm not sure about that
[11:33:03] <Flipp_> ::shrugs:: so I can change the fuses around and they seem to take fine, it just always happens to land in my bootloader. not complaining or anything, just trying to figure out why :)
[11:33:16] <Flipp_> yeah, I was wondering that
[11:33:48] <Flipp_> I wonder if there's not some failsafe where it tries to start at 0x00000, sees the FF opcode (which is invalid), then tries to start at the bootloader address... or something
[11:35:39] <RikusW> it can wrap around...
[11:36:04] <RikusW> meaning the execution starts at the proper place, goes to 0 then all the way to 0x1e000
[11:37:05] <RikusW> once normal fw is loaded at 0x0 this effect will cease to work
[11:37:31] <Jan-> hey, it's tomitticks and rikus!
[11:37:36] * Jan- brings a tray of cakes
[11:38:21] <Lambda_Aurigae> 0xff doesn't cause a restart to the reset vector?
[11:38:58] <Flipp_> rikusw: ah, ok. so it just skips invalid opcodes (e.g. 0xFF)?
[11:39:04] <RikusW> yes
[11:40:39] <Flipp_> ok, phew, that makes a lot more sense. I read that invalid opcodes send it back to the reset vector like Lambda_Aurigae suggested
[11:41:21] <Flipp_> I couldn't find an exhaustive list of avr opcodes that suggested 0xFF was a noop instead of an invalid one
[11:42:14] <RikusW> 0xFFFF = SBRS r31,7
[11:42:50] <RikusW> err, maybe not
[11:43:12] <Flipp_> SBRS suggests it's 1111111rrrrr0bbb, right?
[11:43:50] <RikusW> yes
[11:43:59] <RikusW> close but not quite
[11:48:00] * RikusW takes one of Jan- 's cakes
[11:49:10] <Flipp_> RikusW: Ah, according to the internets "0xFFFF decodes to an illegal instruction, and is treated as a NOP."
[11:49:25] <Lambda_Aurigae> then it will just fall through.
[11:49:46] <RikusW> sounds about right
[11:50:00] <Flipp_> yup, that makes sense. though I coulda sworn I read somewhere that an illegal instruction would reset to boot vector
[11:50:09] <Flipp_> maybe that has to be enabled or something though
[12:12:30] <tpw_rules> anybody familiar with ps/2 keyboards? mine is scanning weirdly
[12:15:02] <Lambda_Aurigae> replace it.
[12:16:15] <tpw_rules> no i mean it's sending scancodes that don't make sense. it surrounds the up arrow scancode with a make/break for $E0 $12 but only if num lock is on
[12:18:07] <specing> replace it.
[12:20:35] <tpw_rules> well it works fine. i just don't know if i'm misunderstanding the docs
[12:26:54] <Lambda_Aurigae> replace the developer.
[12:30:28] <Jan-> what is it with americans and dropping the H on "herbs"
[12:31:59] <RikusW> maybe they smoked too much :-D
[12:43:41] <Tom_itx> herb is an ole phart's name
[12:55:25] <Lambda_Aurigae> americans don't pronounce the H on a lot of things
[12:55:41] <Lambda_Aurigae> and most don't know to put an "an" in front of a word that starts with "h"
[12:55:49] <Lambda_Aurigae> rather than an "a"
[12:56:10] <twnqx> an human?
[12:56:29] * twnqx is not american but still wouldn't do it
[12:56:33] <Lambda_Aurigae> hehe.
[12:57:22] <Lambda_Aurigae> if the H is silent you use an...if it is pronounced you use a.
[12:58:11] <Lambda_Aurigae> at least in american english.
[15:50:10] <Fleck> kas ir Romualds?
[15:50:13] <Fleck> ko tupi? :P
[15:50:22] <Romualds> pac ko tupi?
[15:50:27] <Romualds> juris
[15:50:35] <Romualds> roma
[15:50:40] <Romualds> sauc kā gribi :D
[15:50:48] <Fleck> vismaz censhos te paliidzeet kaadam, tu? :D
[15:51:41] <Fleck> es zinu ka tu ROMA...
[15:55:26] <Romualds> es arii dazreiz izklaideeju :D
[15:58:52] <Lambda_Aurigae> acka oggla flodan
[15:59:37] <Boner> So I have this arduino compatable homemade board. Cant seem to figure out what is wrong with my atmega8u2 TQFP package. The 8u2 powers takes code, gives me LED lights, even registers as A mega or UNO , I am aware of the LUFADeans work,(guess he did all of this code for ardrino too) compiled that driver, it uploads turns on LEDS, will not register
[15:59:50] <Boner> lsusb wise.. :-(
[16:00:25] <Lambda_Aurigae> no clue on arduino stuff.
[16:00:27] <Casper> Boner: wrong crystal? wrong clock fuse?
[16:00:43] <Boner> my command to upload code .. avrdude -p at90usb82 -F -P usb -c usbtiny -U flash:w:USBtoSerial.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m
[16:00:58] <Casper> what about the possible clkdiv8 fuse or other simmilar?
[16:01:21] <Boner> 16mhz external crystal to the schematic of mega/uno
[16:01:34] <Casper> with proper caps on the xtal?
[16:03:03] <Boner> yes sir, xtal1 with a 27r going to crystal. 20pf caps, 1mohm resister between the 2
[16:03:27] <Lambda_Aurigae> resistors on crystal?
[16:03:35] <Boner> I have 2 other chips on this board with the exactly the same xtal setup. they work the mega328 and a mega2560
[16:04:38] <Boner> So anyway it registers on the computer with a mega or uno. But as soon as I try to poll data it crashes dead
[16:04:50] <Boner> mega or uno CODE btw
[16:05:43] <Boner> been searching for weeks reading forms and learning alot, but still not making it work...
[16:05:59] <Boner> I'm not a forum kinda guy
[16:06:09] <Boner> so I figured I'd start my questions here
[16:07:57] <Casper> Boner: resistor on crystal?!? where the heck did you read that you need resistor there?
[16:09:31] <Boner> I was frustrated wanting to test the rest of my board, hooked up an external serial to usb using FDTI chip all my other stuff seems to be working as desired. But this atmega8u2 is a big hangup right now....
[16:10:01] <Boner> as for the resistor between the 2... Just look at the many schematics, some use it, some dont
[16:10:14] <Boner> even if I remove it, it still doesnt work... btw
[16:10:39] <Boner> again same setup on an atmega328 and an atmega2560, they work JUST FINE
[16:10:44] <Lambda_Aurigae> well, if it enumerates then you have crystal running at the right frequency.
[16:11:05] <Boner> thats what I thought..... But I am stuk here
[16:11:10] <Boner> I'm not a debug pro
[16:11:18] <Lambda_Aurigae> talk to ardweeny people about it not working beyond that.
[16:11:58] <Boner> woa... na I used LUFA deans privite code and that wont even register but appears to power and led light on...
[16:12:14] <Boner> I need to figure the code anyway if I want my device correct
[16:12:23] <Boner> vid/pid yes I plan on buying
[16:13:51] <Boner> maybe I should just ask dean....
[16:13:58] <Lambda_Aurigae> probably best.
[16:14:02] <Lambda_Aurigae> he knows his code.
[16:14:33] <Boner> figured Id run my situation by the crew first, didnt want to waste Deans time
[16:15:17] <Boner> thanks for the quick brainstorm thought! I appreciate that!
[16:15:40] <Lambda_Aurigae> again, if it enumerates then the code is running...at least in part.
[16:18:33] <Boner> It seems half alive to me. Code has uploaded from the start never any issues with that, but as soon as I goes to poll data from /dev/ttySCM0 it crashes hard leds off no response... So I was thinking the hardware is ok, I even tried a different atmega8u2. I've tried anything hardware wise I could possibility think of. So I just am unsure code or whathaveyou
[16:19:02] <Lambda_Aurigae> sounds like code issue to me somewhere.
[16:19:16] <Lambda_Aurigae> how are you polling data from the cdc port?
[16:19:35] <Lambda_Aurigae> without seeing the code, we have no way really to help you.
[16:19:57] <Boner> I have a program that was written used for this project specific stuff... and even the Arduino IDE or my Eclipse IDE
[16:20:29] <Boner> its deans code, you can download it
[16:20:42] <Boner> fro the atmega8u2
[16:21:18] <Boner> my code program wise is irrelevant to the problem good sir!
[16:21:40] <Boner> its not my code I shhold be corerect here I use this program
[16:21:56] <Boner> same with Arduino IDE and Eclipse
[16:22:26] <Boner> they work fine with my original Ardunio BS from all programs involved
[16:22:32] <Boner> this not so much
[16:22:39] <Boner> my board that is
[16:24:09] <Boner> fun fun.... just want it polling data :-) then all is well!!
[16:34:48] <Romualds> bet vispaar teu taisniiba Fleck.. Nau ko seedeet tur kur neko nerunaa.. Mani no elektronikas izbanoja par to ka jautaaju par HV :D.. Ataa
[16:37:01] <xa0z> heh
[16:37:12] <Fleck> ;p
[16:41:10] <xa0z> Does the kid who made that USBPass come in here?
[16:42:22] <Fleck> !seen
[16:42:28] <Fleck> .seen
[16:42:34] <Fleck> no clue xa0z
[16:43:01] <xa0z> damn, I can't get this stupid thing to compile for anything.
[16:43:42] <xa0z> He didn't say it required the use of the LUFA build stuff, which I got, and now it throws all kinds of errors when running "make"
[16:49:33] <Boner> Do you have all the dependences installed?
[16:50:02] <Boner> make clean first
[17:15:18] <Lambda_Aurigae> Boner, how you are polling might be a problem...hence the need to see the code.
[17:15:56] <Lambda_Aurigae> if you are going into a loop that somehow takes too much processor time or interferes with the system polling the usb then it will cause the usb system to hork hairballs.
[17:26:57] <xa0z> Boner, I dunno? I have all the avr-* stuff installed, I have the LUFA stuff, just dunno where to go next.
[17:29:54] <xa0z> Boner, it does say I'm missing dependancies, and operators when I run 'make'
[17:30:51] <Lambda_Aurigae> so go through the errors one at a time and see what is missing or messed up.
[17:31:32] <xa0z> http://pastebin.com/T6z3jbs9
[17:32:21] <Lambda_Aurigae> again, go through it one line at a time and look at things and see what's going on.
[17:32:39] <Lambda_Aurigae> first errors are from the makefile..that tells me you haven't configured something.
[17:34:05] <xa0z> the "need an operator" lines are all ifneq statements.
[17:34:22] <Lambda_Aurigae> again, something isn't configured somewhere.
[17:35:13] <xa0z> I sure don't understand where.
[17:35:21] <xa0z> That's part of what the problem is, I know.
[17:36:11] <xa0z> I can look at the files all day long but I don't understand how it's throwing an error.
[17:36:38] <Lambda_Aurigae> what is line 31 of the makefile?
[17:36:41] <xa0z> It's ifeq, not ifneq, that was a typo.
[17:36:42] <Lambda_Aurigae> better yet, post the makefile
[17:36:51] <xa0z> ifeq ($(LUFA_PATH),)
[17:36:52] <xa0z> ok
[17:37:21] <Lambda_Aurigae> have you set LUFA_PATH in your system environment variables?
[17:40:03] <Lambda_Aurigae> or set it in the makefile?
[17:40:17] <Lambda_Aurigae> have you read the docs about configuring and building lufa apps?
[17:41:16] <xa0z> I did set the LUFA_PATH in my PATH and in the Makefile
[17:42:00] <xa0z> http://pastebin.com/LWtXg2rY
[17:44:32] <xa0z> with 'gmake' it gives me a different set of errors.
[17:47:58] <Lambda_Aurigae> gmake and make have different rulesets and are not cross compatible.
[17:49:06] <Lambda_Aurigae> one of the things I'm seeing with some of your errors is the makefile might want tabs where you have spaces.
[17:49:55] <xa0z> When I ran gmake, it gave errors about VERSION_BCD only having one version number supplied, where 3 were required.
[17:50:38] <xa0z> The source is exactly as provided except for my LUFA path.
[17:51:08] <Lambda_Aurigae> what have you used to edit it?
[17:51:43] <xa0z> nano
[17:52:13] <Lambda_Aurigae> and does nano convert tabs to spaces?
[17:52:18] <Lambda_Aurigae> http://www.cs.usask.ca/staff/oster/makefiles.html
[17:52:19] <xa0z> Not that I know of.
[17:52:39] <Lambda_Aurigae> in what you posted there are no tabs unless pastebin converts them.
[17:56:50] <xa0z> It might hav.
[17:56:53] <xa0z> have*
[18:10:48] <Boner> Lambda, I am polling thew any app. again, mine, or the Arduino IDE, Or my Eclipse IDE environment. So anything polling the port as normal causes this issue... So for instance, if I wanted to I should be able to pretent my board is a mega2560 clone and use as a normal 2650 board. So its not program specific. Same result everywhere. As soon as I request data from /dev/ttyACM0 the chip crashes
[18:10:56] <Boner> thats my best way to sum this up
[18:11:16] <Boner> I do not think its specific to the program looking at that port
[18:11:37] <Boner> but within the hardware. I could be wrong, but not sure what to try next
[18:12:15] <Boner> code is here if you want to look https://code.google.com/p/multidisplay/wiki/SetupEclipse
[18:13:16] <Boner> but this works fine with my beta board and regular aruino. or as I said my board works exaclty the same using an external USB to serial connection. I knew I went wrong not using the FTDI device insted of the 8u2
[18:29:04] <Boner> linked the wrong code, this is for the desktop.. https://code.google.com/p/multidisplay/wiki/SetupQtCreator
[18:29:22] <Boner> I'll brb, need to get a few things done, thanks again for any help!!!!!!!!!! :-)
[18:47:55] <Lambda_Aurigae> ok...so there is something with the CDC side on the microcontroller.
[20:07:06] <koolatron> How long does a pulse need to be for the PCINT interrupt hardware to catch it?
[20:07:16] <koolatron> In general, that is
[20:08:09] <koolatron> I've got a 1 Hz clock coming out of this atomic clock module, but the pulse is only 1us long
[20:09:17] <koolatron> If I have to mess around with an 555 circuit to lengthen the pulse, that's fine, but I'm hoping it won't be necessary
[20:10:21] <xa0z> Lambda_Aurigae, where would the tabs be?
[20:10:47] <Tom_itx> http://www.wsj.com/articles/nxp-semiconductors-in-advanced-talks-to-combine-with-freescale-semiconductor-1425245923
[20:24:20] <xa0z> StdDescriptors.h:113:67: error: invalid operands to binary & (have 'double' and 'int') --> CPU_TO_LE16( ((Major & 0xFF) << 8)
[20:29:00] <Casper> koolatron: I think the pulse need to be atleast 1 clock wide to be able to trigger the hardware, and a few clock to be able to determine which pin in the same interrupt triggered it (enought to enter the interrupt and save the port)
[20:29:55] <koolatron> Casper: ah, then 1us is more than enough clocked at 16MHz
[20:30:05] <koolatron> ~16 clocks should hopefully be enough that is
[20:31:30] <xa0z> Wow, wtf
[20:31:46] <xa0z> I just removed the Major & 0xFF from the CPU_TO_LE16 and it built.
[20:31:56] <xa0z> err, the Major &, removed that.,
[20:36:30] <xa0z> However, it won't flash the .hex
[20:36:47] <xa0z> http://pastebin.com/SUyy10z2
[21:04:18] <xa0z> Finally got it flashed, had to use a different USB port, however I guess the USB HID device it's emulating isn't available for me because dmesg shows the following
[21:04:20] <xa0z> sb_alloc_device: set address 2 failed (USB_ERR_IOERROR, ignored)
[21:04:20] <xa0z> usbd_setup_device_desc: getting device descriptor at addr 2 failed, USB_ERR_IOERROR
[22:27:03] <xa0z> Tom_itx, you around?
[22:44:50] <xa0z> I mentioned my issue to the kid who wrote the USBPass program and he replied to me with this...
[22:44:52] <xa0z> The 32u2 comes factory programmed to need a 2mhz clock input, an oversight my part. (The datasheet says it defaults to internal osc, but they don't mention that the usb bootloader they flash changes this). For first time bringup I had to use a function generator to feed the clock pins, then I was able to change the fuses to use the internal osc, which worked fine for usb.
[22:47:01] <grey> blarg. So I did end up getting an Atmel ICE, PCB only, expecting to be able to easily wire my own cabling for it, but they used these tiny little 0.5mm 2x10 cable headers, and they want $60 just for the cable kit
[23:18:04] <grey> I can't find a good alternative on amazon/ebay, digikey wants $66 for the kit, Atmel wants $40 but I don't know what they'd want to ship it to Canada
[23:19:02] <grey> bringing my total up to just above what the entire kit, plastic enclosure and usb cable would have cost me on digikey. So. Lesson learned, don't ever ever recommend anyone buy http://www.digikey.ca/product-detail/en/ATATMEL-ICE-PCBA/ATATMEL-ICE-PCBA-ND/4753383 unless they're replacing an existing unit or something
[23:30:04] <xa0z> grey, check Mouser?