#avr | Logs for 2012-12-23

Back
[02:55:51] <RikusW> there is one thing I don't quite get, when reading fuses or signature using RavrProgRtk its nearly instantaneous, but when using AS4 there is at least 0.5s delay... :S
[02:56:46] * RikusW will have to go test avrdude...
[03:10:38] <RikusW> hmm avrdude lags a little..
[04:10:59] <RikusW> hi philfine
[04:11:39] <RikusW> philfine: I tested the mki with avrdude 5.10, reading fuses works fine for me
[04:40:18] <philfine> Hi
[04:40:20] <philfine> Sorry
[04:40:46] <philfine> Can you tell me how do you set avrdude for your device
[04:40:51] <philfine> Just to be sure
[04:41:09] <philfine> It is jtag1, jtagmkI, stag1slow right ?
[04:41:25] <philfine> RikusW: ping
[04:44:37] <RikusW> yes
[04:44:38] <philfine> What could happen to make it even not reply the Ok
[04:44:41] <RikusW> that should work
[04:45:13] <philfine> I am connected to a mac, I will try linux in any case
[04:45:22] <RikusW> ok
[04:45:23] <philfine> But that should not be the problem
[04:45:40] <RikusW> loaded the fw I mailed today ?
[04:46:05] <philfine> Yes
[04:46:15] <RikusW> working better ?
[04:47:39] <RikusW> try -> avrdude -P /dev/ttyACM0 -c jtagmki -p m128 -t
[04:47:40] <philfine> same thing on linux
[04:48:13] <RikusW> jtag1 should work too
[04:48:25] <RikusW> does it read the signature ok ?
[04:48:51] <philfine> Nope
[04:48:54] <philfine> avrdude: jtagmkI_send(): sending 6 bytes
[04:48:54] <philfine> avrdude: Send: R [52] . [b2] . [02] . [00] . [00] . [00] [20] [20]
[04:48:55] <philfine> avrdude: ser_recv(): programmer is not responding
[04:48:56] <philfine> avrdude: jtagmkI_recv(): failed to send command to serial port
[04:49:18] <RikusW> reset the mki avr ?
[04:49:37] <RikusW> you connected tdo -> tdo right ?
[04:49:43] <RikusW> and tdi -> tdi
[04:50:56] <RikusW> how about the JTAGEN fuse on the target avr ?
[04:51:15] <RikusW> and which version of avrdude are you using ?
[04:51:21] <RikusW> I tested on 5.10
[04:51:37] <philfine> let me read the fuses with the ISP
[05:00:43] <philfine> Now the arduino doesn't want to work as a ISP :S
[05:01:19] <jacekowski> looks like disabled reset
[05:01:29] <jacekowski> sounds like you need HVP
[05:01:42] <philfine> I have to redduce speed
[05:01:46] <philfine> I totally forgot that
[05:04:17] <RikusW> yep, common gotcha
[05:04:27] <RikusW> what was it ? and what is it now ?
[05:06:41] <philfine> avrdude: safemode: lfuse reads as E
[05:06:41] <philfine> avrdude: safemode: hfuse reads as 9
[05:06:42] <philfine> avrdude: safemode: efuse reads as FF
[05:06:43] <philfine> avrdude: safemode: Fuses OK
[05:07:05] <philfine> 9 seems to have JTAGEN = 0
[05:07:09] <RikusW> on which avr ?
[05:07:14] <philfine> atmega64
[05:07:16] <RikusW> 0 is enabled
[05:07:22] <philfine> Ok
[05:07:35] <philfine> I guess the problem is the controllers connected to the line
[05:07:51] <RikusW> what is the clock on the m64 ?
[05:08:09] <RikusW> that might be the jtag problem too...
[05:08:21] <philfine> 1 second I will open the schematics and give you the link
[05:08:50] <philfine> http://th9x.googlecode.com/svn/trunk/doc/schaltplan-transmitter.pdf
[05:09:11] <philfine> 16M
[05:10:19] <philfine> TDI is supposedly reading current from the battery
[05:10:24] <philfine> voltage
[05:10:35] <philfine> Maybe thats the problem :D
[05:12:41] <RikusW> how about BOD fuses ?
[05:14:05] <RikusW> are you using 5V ?
[05:15:27] <philfine> yes
[05:16:28] <RikusW> what was the SPI clock when it didn't work ?
[05:16:42] <RikusW> you could try lowering the jtag clock...
[05:17:36] <philfine> you mean in avrdude
[05:17:53] <philfine> I did try with 9600
[05:17:55] <RikusW> yes
[05:18:06] <philfine> So not that problem :S
[05:18:07] <RikusW> why is there caps connected to PF4 5 6 7 ?
[05:18:15] <RikusW> that will mess with the signal...
[05:23:44] <philfine> To be honest I know little about electronics
[05:24:05] <philfine> RikusW: I can take them out if you think that is the problem :)
[05:24:34] <RikusW> connect only the jtag signals to those pins, and nothing else..
[05:24:39] <RikusW> that should help
[05:34:36] <philfine> Nope
[05:34:39] <philfine> :*
[05:34:41] <philfine> :(
[05:34:49] <philfine> Directly connected did not work
[05:35:08] <philfine> Should I power the target as well just to be sure :D
[05:35:08] <RikusW> do you have any other jtag avrs ?
[05:35:18] <philfine> Nope
[05:35:27] <RikusW> ofcourse...
[05:35:38] <RikusW> I powered it from the usb side
[05:35:40] <philfine> I have other atmegas but it would be painful to wire them :D
[05:35:46] <RikusW> is the remote 5V too ?
[05:35:47] <philfine> I will try that too
[05:36:14] <RikusW> and do remember to connect vcc -> avcc when wiring another mega...
[05:36:40] <RikusW> if its DIP and you have breadboard its not that hard to wire ;)
[05:37:53] <philfine> Did not work
[05:39:11] <RikusW> how did you get it to work last time ?
[05:48:34] <philfine> Well it is still flashing with avarice
[05:48:48] <philfine> And I never did actually make it work with avrdude
[05:49:08] <philfine> But avarice programming is deprecated and also I would like to be able to read/write eeprom
[05:49:14] <philfine> As is I cannot :S
[05:50:14] <RikusW> avarice should be able to...
[05:50:32] <philfine> What is the reason for not getting the Resp_OK ?
[05:50:34] <RikusW> so avarice works as it is now ?
[05:50:40] <philfine> yes
[05:50:51] <RikusW> weird, avrdude should work..
[05:51:07] <RikusW> there is many reasons for not getting Resp_OK
[05:51:09] <RikusW> *are
[05:52:07] <RikusW> what your avrdude version ?
[05:52:27] <RikusW> do you perhaps have the Qt4 dev files installed ?
[05:52:34] <RikusW> you could download my gui..
[05:53:02] <RikusW> and compile it
[05:54:10] <RikusW> RavrProgQt should work..
[05:55:18] <RikusW> and do use the jtagice, not U2S in the gui
[06:03:40] <philfine> Sorry
[06:03:48] <philfine> busy with something else too :)
[06:04:24] <Steffanx> How's that project going RikusW ?
[06:04:36] <RikusW> which one ?
[06:04:44] <Steffanx> ravr
[06:04:50] <RikusW> RavrProgRtk is going well enough :)
[06:05:01] <RikusW> got the fuse tab mostly done
[06:05:03] <philfine> Rikus: I tried several versions 5.11 is the latest I tried
[06:05:09] <Steffanx> The Rtk version is the less interesting one :P
[06:05:14] <RikusW> but still have to invent a hex editbox for Rtk...
[06:05:41] <RikusW> I had to build a combobox too ;)
[06:05:51] <RikusW> it didn't exist when I started porting
[06:06:11] <RikusW> and some of the control positioning code is still buggy :S
[06:06:16] <Steffanx> So the important part of ravr is fully functional?
[06:06:22] <RikusW> mostly
[06:06:39] <RikusW> will have to check on flash verification code
[06:07:44] <RikusW> I totally restructured the directories containing the source
[06:07:57] <RikusW> its all one big VS workspace now
[06:08:15] <RikusW> and it compile in Linux too
[06:08:47] <RikusW> now just to get my hands on macos to run in a VM ;)
[06:08:57] <RikusW> then I can port Rtk to mac too
[06:09:07] <RikusW> but maybe xlib will work
[06:10:17] <RikusW> Steffanx: will have to figure out usb on windows...
[06:10:36] <RikusW> either get libusb for win or use the native win usb code
[06:14:46] <Steffanx> libusb for windows isn't that bad is it?
[06:15:29] <philfine> RikusW: Any wild guess at this point ?
[06:16:23] <philfine> What are the verifications you mentioned I would have to comment out
[06:19:07] <philfine> My former question was incorrect
[06:19:20] <philfine> Any reason for not getting any replay at all to those read commands ?
[06:19:45] <philfine> It is like the jtagmki is not replying to the read command
[06:19:57] <philfine> Stuch in getc or something
[06:20:02] <philfine> stuck
[06:20:15] <RikusW> hmm not sure
[06:20:22] <RikusW> it works for me
[06:20:29] <philfine> Come on
[06:20:35] <philfine> avrdude does not get a reply
[06:20:53] <RikusW> you don't mess with the JTD bit by any chance ?
[06:21:09] <RikusW> but then again that would disable the jtag entirely
[06:21:31] <RikusW> the verify code is for my gui, not the mki
[06:21:37] <philfine> I sent you the print out of the very verbose version
[06:22:26] <philfine> Maybe you want the full output :)
[06:22:30] <philfine> let me paste it
[06:22:38] <philfine> somewhere else
[06:23:41] <RikusW> so 0x78 gets a response...
[06:23:54] <RikusW> but 52 b2 dont ?
[06:23:55] <RikusW> ugh
[06:24:25] <philfine> http://justpaste.it/1nux
[06:24:36] <philfine> No 52 gets a respondse
[06:24:55] <philfine> If I comment out that read from the avrdude code
[06:25:02] <philfine> It stops on the read to verify the flash
[06:30:17] <philfine> RikusW: Can you compile the code for 16MHz too
[06:30:42] <RikusW> do you have 16MHz crystal for the usb162 ?
[06:31:08] <philfine> I have here a 16MHz one don't know if it will work in the usb162
[06:31:37] <philfine> It says SDE 16MHz 20pf
[06:31:52] <philfine> Should it work ?
[06:33:13] <RikusW> it should
[06:33:29] <RikusW> I use 16MHz on U2S with m32u2
[06:33:45] <RikusW> mailed you the 16MHz version
[06:34:04] <RikusW> but it seems the CDC is not the problem
[06:34:31] <RikusW> if it enumerates it means the frequency setup was done right
[06:34:46] <RikusW> and I run the mki at 8MHz anyways by using clk/2
[06:38:50] <RikusW> lol -> http://ruggedcircuits.com/html/ancp01.html
[06:41:16] <OndraSter> lol RikusW
[06:41:28] <devilsadvocate> Rofl
[07:36:00] <philfine> How is it possible that I have an atmega128 that returns signature of a atmega64 ?
[07:36:08] <philfine> Did I trashed this one ?
[07:36:18] <devilsadvocate> It isn't, in principle
[07:36:38] <philfine> Well it is happening :S
[07:36:49] <devilsadvocate> Unless perhaps you're using a bootloader which not properly compiled
[07:37:33] <devilsadvocate> Or if the difference is small, it may be some minor communication glitch, although that should not happen every single time
[07:38:13] <philfine> ISO
[07:38:14] <philfine> ISP
[07:38:57] <devilsadvocate> If you can try with a different programmer, do that
[07:39:04] <devilsadvocate> Or with a different chip
[07:40:59] <philfine> My mistake
[07:41:14] <philfine> have two programmers at the same time connected
[07:41:16] <philfine> using wrong one
[07:41:29] <Steffanx> heh
[07:47:29] <philfine> Can someone the safe fuses for an atmega128 to allow JTAG
[07:47:44] <philfine> Should the Brown out fuses be 0 or 1
[07:48:21] <devilsadvocate> philfine: Theres a fuse calculator online
[07:48:49] * devilsadvocate just prefers to use that instead of working out the polarities
[07:50:19] <philfine> can you please What is Brown out detection enabled ?
[07:50:53] <devilsadvocate> As in what it means?
[07:50:59] <philfine> yes
[07:50:59] <philfine> :D
[07:51:28] <devilsadvocate> It shuts off the chip if the supply voltage drops below a certain voltage
[09:09:50] <ok9swl> join #gnu
[09:10:01] <ok9swl> oops, sorry
[09:12:14] <tzanger> morning
[09:12:36] <tzanger> philfine: that -fdump-tree-all gives me about a billion intermediate files... which are of use?
[09:23:13] <tzanger> philfine: whoa
[09:23:44] <tzanger> FILE uart_io = FDEV_SETUP_STREAM(my_putchar, my_getchar, _FDEV_SETUP_RW);
[09:23:47] <tzanger> ^^ doesn't work
[09:24:06] <tzanger> FILE *uart_io = fdevopen(my_putchar, my_getchar);
[09:24:08] <tzanger> ^^ works fine
[09:24:45] <tzanger> similarly, fdev_setup_stream, &uart_io, my_putchar, my_getchar, _FDEV_SETUP_RW); also failed
[09:29:20] <tzanger> yep, changed the original program (not just the test program) and everything is happy again
[09:29:32] <tzanger> I have no idea why the macro decided to stop working
[09:57:04] <philfine> tzanger: I believe the only file you should be interested would be the ones with the biggest value
[09:57:22] <philfine> That is the dump just before converting into ASM intermediate representation
[10:00:23] <philfine> To debug the macro expansion you can do -P dumping the code after preprocessing
[10:01:06] <philfine> Be sure to include the AVR version of stdio
[10:01:42] <philfine> Otherwise the macro expansion could be for a totally different target, being that painful to debug
[10:10:11] <tzanger> -P dumping?
[11:16:35] <tzanger> wait wait wait
[11:16:38] <tzanger> I bet I know what is going on philfine
[11:16:53] <tzanger> philfine: fdevopen() malloc()s the FILE struct
[11:17:09] <tzanger> the macros want a variable to already exist
[11:17:13] <tzanger> jesus I'm stupid
[11:17:36] <tzanger> void some_func(void) { FILE foo = FDEV...; } puts foo on the stack
[11:17:49] <tzanger> I need static FILE foo if I'm using the macros so they're part of bss.
[11:17:57] <tzanger> head. fucking. desk.
[11:18:17] <philfine> :D
[11:18:30] <tzanger> philfine: thank you for the assistance.
[11:18:34] <tzanger> I do appreciate it
[11:18:36] <tzanger> I'm just retarded.
[11:18:39] <tzanger> ugh
[11:18:44] <philfine> I once struggled after a loop with a ; right after the while
[11:18:50] <Grievre> tzanger: Why are you even mucking with FILEs instead of just using pointers?
[11:18:53] <tzanger> haha yes that happens
[11:19:04] <tzanger> Grievre: redirecting stdio to UART routines
[11:19:41] <tzanger> Grievre: pointers require malloc() which I have room for, but I did not realize that during my code refactoring that I moved the FILE var into a function rather than keeping it a global
[11:20:10] <tzanger> fdevopen() worked great because it uses malloc so the FILE struct didn't get put on the stack
[11:20:29] <Grievre> ah ok
[11:20:42] <tzanger> philfine: I often do if (! (foo = bar())) { error_case }
[11:20:54] <tzanger> philfine: and every once in a while I forget the parens around the assignment
[11:21:13] <tzanger> philfine: that usually costs me at least 10 minutes of debug time, followed by at least an hour of self-flagellation in pennance
[11:21:39] <tzanger> this idiotic bug though, cost me about a day of real time (two or three days of wall time)
[11:25:10] <tzanger> going back to the macro saved me another 200 bytes of program space
[11:25:25] <tzanger> I'm not constrained in RAM yet but I prefer to avoid the malloc()
[11:26:15] <RikusW> philfine: I'm not quite sure what the problem is...
[11:26:40] <philfine> It is really strange
[11:26:40] <RikusW> philfine: dos the mki read the chip signature at least ?
[11:26:55] <philfine> It is like after that command the chip stopped replying
[11:27:04] <philfine> Of course
[11:27:12] <philfine> I can even debug with avarice
[11:29:38] <philfine> And now I even have the debug on both the chips
[11:29:48] <RikusW> very weird
[11:30:05] <RikusW> it works just fine with AVRStudio 4.18 sp3
[11:30:12] <philfine> It must be some subtlety from usb162
[11:30:21] <manoja328awesome> has anybody used vusb for avr microcontrollers. i want to send audio from atmega by ADC ing it and sending in usb format . is it possible??
[11:30:40] <philfine> RikusW: Did you try it with avrdude
[11:30:57] <RikusW> yes
[11:30:58] <philfine> Can you get a communication dump from a flash write in avrdude
[11:31:00] <RikusW> and it worked
[11:31:11] <philfine> I mean use -vvvvv and paste it somewhere
[11:31:19] <specing> manoja328awesome: yes
[11:31:29] <philfine> So I can compare if there is any communication difference
[11:31:37] <specing> with questionable quality
[11:32:47] <RikusW> philfine: reading a fuse should be fine ?
[11:33:01] <manoja328awesome> specing : u know how fast can it be in atmega8
[11:33:19] <philfine> It should
[11:33:24] <tzanger> I found avrdude has some trouble with mk1
[11:33:25] <philfine> Certainly it will also fail
[11:33:36] <tzanger> you can write the fuses fine but the standard "write and read back" fails on the read back every time
[11:33:40] <tzanger> if you *just* read it reads fine
[11:34:04] <tzanger> so when bringing up a new device I use avrdude 3 times, once for each of lfuse, hfuse and efuse
[11:34:09] <RikusW> philfine: there is one thing debug and non debug mode use different functions for reading flash..
[11:34:35] <specing> manoja328awesome: speed depends on your ability to write good code and the frequency and working range of the MCU used
[11:36:19] <philfine> Strange enough it is reading fuse fine
[11:38:06] <philfine> Reading flash also works
[11:38:13] <philfine> Although the content might be wrong
[11:38:17] <RikusW> now what did you do ?
[11:38:36] <RikusW> seems dumping with > doesn't work ?!
[11:39:26] <RikusW> and if I do 2&>1 > temp.txt it dumps only a few lines :S
[11:40:10] <philfine> 2> name_of_file
[11:40:29] <philfine> just use 2>
[11:40:47] <philfine> please do the dump for the flashing operation
[11:40:51] <philfine> flash write
[11:41:37] <RikusW> so flash read works ?
[11:41:43] <vectory> it should be 2>&1 instead of 2&>1 no?
[11:41:45] <philfine> flash read works
[11:41:51] <philfine> eeprom read works
[11:41:54] <philfine> any write fails
[11:42:14] <RikusW> eeprom write ?
[11:44:31] <philfine> Let me check
[11:45:03] <RikusW> check the value of parameter 0x70...
[11:47:57] <RikusW> philfine: it should be 0x1C on older avrs and 0x1F on new
[11:48:19] <RikusW> its my custom eecr parameter allowing new avr flash writing
[11:48:39] <philfine> you mean on a write
[11:48:43] <philfine> flash write
[11:49:15] <RikusW> yes its for eeprom and flash
[11:49:30] <RikusW> avr's with EECR = 1F use the new flash algorithm
[11:49:37] <RikusW> so I used that
[11:50:03] <RikusW> the mkit app should allow you to read parameter 0x70 to verify its 0x1C on m64 and m128
[11:52:34] <philfine> Ok, let me compile mkit again
[11:52:46] <philfine> It is the same version as you sent me 1year ago right ?
[11:56:16] <philfine> How should I execute mkit
[11:56:25] <philfine> Iit just hanged
[11:57:11] <philfine> RikusW:
[11:58:08] <RikusW> philfine: you probably got the windows version
[11:58:13] <Grievre> What kind of converter do the 0.7V ATTinys have on them?
[11:58:24] <Grievre> Charge pump? MEMS inductor?
[11:58:35] <philfine> I have the source
[11:59:14] <RikusW> RCom is portable
[11:59:17] <philfine> I compiled it for mac os x
[11:59:20] <RikusW> mostly
[12:00:07] <RikusW> if you do get it working press -> q then 70
[12:00:11] <RikusW> q <enter>
[12:00:17] <RikusW> hmm just q
[12:01:05] <RikusW> but thats the ultimate debug tool for the debugger ;)
[12:02:24] <philfine> 41 1c 41
[12:02:39] <philfine> RikusW:
[12:03:21] <philfine> seems like a older one
[12:04:08] <RikusW> great
[12:04:15] <RikusW> thats just right
[12:04:27] <RikusW> m64 is older, its EECR is at 1C
[12:04:46] <RikusW> you'll have to read the command switch to see available commands
[12:04:49] <philfine> So what should I do
[12:04:57] <RikusW> but you can do a great deal of stuff with mkit
[12:05:19] <RikusW> you can test the mki with it
[12:05:42] <philfine> Can you please guide me :D
[12:05:56] <philfine> So we now know it is the older algorithm
[12:06:11] <philfine> And you are testing using the new algorithm right ?
[12:06:46] <RikusW> you could use the W command to test writing flash, but be prepared to type 128 hex bytes or so :-P
[12:06:54] <RikusW> or paste it..
[12:07:21] <philfine> I can generate those :D
[12:11:28] <philfine> How should be the input of mkit for the hex files
[12:11:37] <philfine> 0x00 0x01 0x02 ?
[12:11:58] <RikusW> lose the 0x
[12:12:09] <RikusW> everything is hh
[12:12:13] <philfine> with a space
[12:12:15] <RikusW> like 45 6f 7a
[12:12:26] <philfine> 128 is enough ?
[12:13:18] <RikusW> or maybe use less...
[12:13:42] <RikusW> remember the count starts at 0 so 0 == 1 and 255 ==256
[12:13:50] <RikusW> ask atmel why
[12:14:54] <RikusW> afk
[12:19:21] <philfine> Rikus, it doesn't seem easy to use mkit to debug this
[12:19:44] <philfine> Moreover, it does not help me understand why avrdude is not working
[12:19:46] <philfine> :D
[12:20:45] <philfine> I am sure in my case avrdude is doing something that crashes the device
[12:27:12] <OndraSter> so I was donated a logic analyzer
[12:28:10] <OndraSter> it is... 25? 30? years old lol
[12:28:13] <OndraSter> Schlumberger 7600E
[12:28:16] <OndraSter> with 32 channel expander
[12:28:23] <OndraSter> and bazilion of probes
[12:28:26] <philfine> RikusW: ?
[12:28:29] <OndraSter> now I need to make a space for it on my table
[12:28:36] <OndraSter> I can't find any info about it on the internet
[12:30:38] <darsie> hi
[12:31:05] <OndraSter> hi
[12:31:23] <darsie> the INT0/1 pins when used for low level interrupts are still meant to be digital inputs, right?
[12:32:17] <darsie> They will draw relatively much current at Vcc/2?
[12:32:34] <rue_mohr> int 1/0 are digital
[12:32:57] <rue_mohr> if you want to interrupt on an analog level, use a chip with a comparitor
[12:33:01] <darsie> How much current will they draw at Vcc/2 or so?
[12:33:09] <rue_mohr> or put an external comparitor on there
[12:33:42] <darsie> Yeah, my atmega168 has analog comperator, and it draws 80 uA. I'm wondering if I can get away with less with INT0/1.
[12:34:00] <rue_mohr> int 0/1 are digital
[12:34:28] <darsie> How much current will they draw at Vcc/2 or so?
[12:34:38] <rue_mohr> measure it
[12:34:43] <darsie> k
[12:34:47] <darsie> 1 mA?
[12:34:49] <rue_mohr> might randomly trigger tho
[12:34:55] <tzanger> what's your comparator circuit look like
[12:35:07] <rue_mohr> well obviously more if you have the pullup enbled
[12:36:17] <darsie> I have a SMPS for a geiger counter and if the voltage overflows through 2 200 V zeners in series, the oscillator shall stop or reduce duty cycle.
[12:36:28] <RikusW> philfine: I'm back, get AVR060.pdf from atmel.com
[12:36:38] <RikusW> its the appnote for the jtagmki protocol
[12:37:18] <RikusW> you can test reading/writing using mkit, but its fairly low level..
[12:37:18] <darsie> rue_mohr: I won't enable the pull ups when measuring voltage.
[12:38:24] * darsie is away eating ...
[12:39:35] <rue_mohr> you wont measure voltage with int0/1
[12:39:52] <rue_mohr> well, you could use an RC circuit
[12:42:38] <rue_mohr> a delta sigma converter
[12:43:16] <tzanger> RikusW: you have a schematic for mk1?
[12:43:57] <RikusW> there is one on the isojtag clone site
[12:44:12] <RikusW> they use the atmel fw on a m16
[12:44:21] <RikusW> mine is custom coded
[12:44:52] <RikusW> http://sites.google.com/site/megau2s/home
[12:44:57] <RikusW> jtag tab
[12:45:04] <RikusW> the jtag pinout is in the source
[12:45:23] <RikusW> it can be loaded onto most avrs
[12:47:04] <tzanger> I was looking at incorporating http://vak.ru/doku.php/proj/bitbang/bitbang-jtag into my designs
[12:47:37] <tzanger> I believe that's identical to the AVR-JTAG-USB from olimex and I use mk1 in avrdude
[12:47:51] <philfine> RikusW: I see that avrdude is setting a parameter not described in the PDF document
[12:48:05] <philfine> 88 89 8a
[12:48:16] <philfine> right before requesting the read
[12:49:08] <RikusW> hmm, lets me have a look
[12:49:26] <philfine> Better, it performs a reset command 78 and then the read
[12:50:11] <RikusW> thats the flash and eeprom pagesize
[12:50:47] <philfine> https://www.dropbox.com/s/88u95ykueor9dm4/avrdude.log
[12:51:13] <philfine> But should a reset be a problem then ?
[12:51:30] <RikusW> not really
[12:51:58] <philfine> I will make a delay in the avrdude code
[12:53:54] <Rikus1> so is fuse reading and flash reading working now ?
[12:56:05] <Rikus1> avrdude: Device signature = 0xffffff
[12:56:15] <Rikus1> that seems to indicate improper connection ?
[12:56:26] <philfine> Sorry
[12:56:29] <philfine> Wrong dump
[12:56:33] <philfine> I will update it
[12:57:20] <philfine> Done
[12:57:25] <philfine> Please check it now
[12:57:33] <philfine> I had the device disconnected
[12:57:42] <rue_mohr> avr wont talk if you screw up the clock fuses
[12:57:55] <rue_mohr> that too
[13:01:26] <RikusW> try removing that reset command ?
[13:01:34] <philfine> Ok
[13:01:54] <Casper> for an AVR to communicate, you need the proper programmer type, apropriate wiring, working part, working fuse and clock and apropriate programming speed
[13:02:08] <Tom_itx> and a bit of noob luck
[13:02:09] <RikusW> the device descriptor command may be wrong, iirc the data format changed....
[13:03:01] <philfine> Just the same
[13:03:59] <RikusW> did you connect the reset line too ?
[13:04:13] <RikusW> try using forced reset maybe
[13:05:01] <RikusW> I'll check out flash writing a bit later, but I'm sure it worked last time I tested :-/
[13:06:27] <philfine> Ok
[13:06:43] <philfine> What do you mean by forced reseting ?
[13:06:44] <philfine> RikusW: ?
[13:07:28] <RikusW> avrdude: jtagmkI_send(): sending 6 bytes
[13:07:30] <RikusW> avrdude: Send: R [52] . [b2] . [02] . [00] . [00] . [00] [20] [20]
[13:07:43] <RikusW> this same command worked just a little up in the log...
[13:08:36] <philfine> Indeed
[13:16:56] <tzanger> hm, the mk1 schematic is an ft232 + a mega16; the olimex is less complex than that, it's only a ft232
[13:17:30] <tzanger> nope I'm wrong
[13:17:46] <tzanger> the avr-jtag-usb is a ft232 +mega16 and a couple optos
[13:17:54] <tzanger> got it open in front of me
[13:18:35] <RikusW> mine does support new avrs, with avrdude hacking...
[13:18:40] <OndraSter> http://www.technologymuseum.eu/phpwebgallery/picture.php?/193/category/19&pwg_id=581a78aeda1b8f39345ba9acc36c36c1
[13:18:42] <OndraSter> this is the beast
[13:18:44] <OndraSter> huge beast
[13:18:55] <OndraSter> with expander for 32 channels
[13:18:58] <OndraSter> and ton of probes
[13:20:00] <RikusW> OndraSter: I got a tektronix RM561A scope
[13:20:28] <RikusW> what is its max speed ?
[13:21:14] <RikusW> OndraSter: its a french machine....
[13:21:14] <tzanger> I've got like a 30 year old HP scope. it's 350MHz and digitizing, but the digitizing is dog slow
[13:21:37] <tzanger> I had a really nice Tektronix 2GHz scope for some conformance testing for a half a year
[13:22:25] <tzanger> oh a logic analyzer... I have a tektronix 1284 with like 96 channels
[13:22:27] <RikusW> OndraSter: seems you have a private museum :-P
[13:22:46] <tzanger> but I use my Saleae usb one FAR more often
[13:23:00] <tzanger> you just don't need wide logic analyzers much these days
[13:23:35] <RikusW> everything tends to be serial..
[13:23:50] <tzanger> yep
[13:24:03] <tzanger> I'm saving up for a nice 2.5GHz DSO
[13:24:14] <RikusW> how much would that be ?
[13:24:20] <tzanger> far too much
[13:24:55] <tzanger> on contract they got a LeCroy 2GHz scope with all the bells and whistles including probes and PCIe analyzer
[13:25:02] <tzanger> that was a $130k oscilloscope
[13:25:10] <tzanger> (not a typo)
[13:25:28] <tzanger> I'd never buy new, get an off lease or something
[13:26:33] <RikusW> thats expensive...
[13:35:17] <OndraSter> RikusW, no idea what is the max speed
[13:35:24] <OndraSter> I can't find anything about it on the internet
[13:35:28] <OndraSter> and yes, it is french
[13:37:32] <DagoRed> tzanger: I <3 LeCroy
[13:37:51] <OndraSter> everybody does
[14:14:54] <froggyman> anyone here use programmers notepad?
[14:15:45] <specing> vim.
[14:17:55] <OndraSter> hmm
[14:18:04] <OndraSter> INT CLOCK PERIOD goes down to 50ns
[14:18:10] <OndraSter> looks like 20MHz sampling rate lol
[14:23:09] <froggyman> actually, I think it's just something with WinaAVR/avr-gcc
[14:23:31] <specing> OndraSter: my stellaris can do that too :D
[14:24:04] <froggyman> sometimes compile times for my current project are 25-30 seconds, and others they are 1-2 seconds... Seems random which it is, and doesn't seem to matter how much code changes
[14:24:39] <OndraSter> specing, but it is not from the 1980!
[14:25:18] * froggyman wonders what OndraSter is trying to do
[14:25:50] <OndraSter> froggyman, I was given from my uncle his superold logic analyzer :D
[14:25:58] <OndraSter> I like old test gear
[14:26:20] <froggyman> OndraSter: ahhh, nice :) Just because it's old doesn't mean it's not worth using
[14:26:36] <OndraSter> aye :D
[14:26:39] <froggyman> the scopes at my school are quite a few years old... but they work just fine still
[14:27:03] <OndraSter> I am using no-idea-how-old analog scope
[14:27:06] <OndraSter> from Kikusui
[14:27:08] <OndraSter> 40MHz
[14:27:27] <OndraSter> btw the logic analyzer has got even unopened package with 30 brand new probes :D
[14:27:30] <OndraSter> as in, wires
[14:28:10] <froggyman> nice deal! The scopes at my school I think are 200MHz
[14:28:18] <froggyman> couldn't tell you for sure though
[14:28:25] <froggyman> maybe 100MHz
[14:33:27] <OndraSter> <OndraSter> INT CLOCK PERIOD goes down to 50ns
[14:33:29] <OndraSter> i lied
[14:33:31] <OndraSter> 10ns
[14:34:10] <specing> LIAR!!!
[14:34:42] <OndraSter> 1023 samples
[14:34:44] <OndraSter> 8 channels
[14:34:47] <OndraSter> that is not much :D
[14:38:04] <froggyman> mmm... LED cube goodness: https://www.facebook.com/video/video.php?v=10200284580305284
[14:39:05] <OndraSter> huh with 32 channel expander I cannot select <32 channels or set it to internal clock... ?!
[14:43:31] <OndraSter> ok I need to clean up my room :D
[14:43:35] <OndraSter> too much stuff here all around.
[14:45:54] <OndraSter> I like the carry bags for the probes ... what about carry bag for the 25kg or so analyzer? lol
[14:46:21] <froggyman> that would cost too much
[14:49:01] <OndraSter> it would have to have some wheels so you could drive it behind you or something
[14:49:05] <OndraSter> I can't imagine wearing it on your back
[15:34:28] <R0b0t1> How would I use a 32.768kHz xtal with a tiny85?
[15:34:52] <R0b0t1> The lowest CKSEL is .4MHz, I mean, I'd assume this is low enough, but data sheet says not to use this with crystals.
[15:41:03] <specing> R0b0t1: low power crystal
[15:42:13] <R0b0t1> ?
[15:43:08] <specing> you have many options
[15:43:14] <specing> INTOSC, HS, LP, ...
[15:43:17] <specing> its LP
[16:48:51] <tzanger> DagoRed: Yes, I loved tek for their mid-level scopes, but LeCroy kills them in high-end. The 2GHz Tek I rented was nice but LeCroy's offering was so much faster and better to use
[16:55:29] <DagoRed> tzanger: I used to beta test the latest DDA's. My god those scopes kick ass. I can't talk about how fast the fastest ones are (we used those designing hard drive read channels).
[16:58:24] <tzanger> Yeah they have a nice architecture where you can upgrade the bandwidth as needed
[16:58:49] <tzanger> I used 2.5 and 4GHz for PCIe but SATA3 needs like 10GHz
[16:59:04] <tzanger> Those probes are like 4k apiece
[16:59:18] <OndraSter> nice
[16:59:34] <OndraSter> somebody buys a car, somebody rents a probe ... for the same money lol
[16:59:44] <OndraSter> (I can't do either of those)
[17:04:20] <tzanger> Lol
[17:05:09] <tzanger> The 4k was purchase price for a 4GHz probe. The rental for the scope and probes and so on was 2k/mo
[17:20:08] <DagoRed> tzanger: I miss my $15k diff probe with my DDA 4000.
[17:20:30] <DagoRed> 400GS/s
[17:20:50] <DagoRed> Scope cost.... a cool $300k
[18:37:13] <nas> how do you printf an unisnged long
[18:39:11] <nas> long is 32 bits right?
[18:39:27] <nas> so i tried uint32_t;
[18:39:43] <nas> and i also tried unsigned long blah;
[18:40:01] <nas> when i printf i try %lu it doesnt work
[18:40:03] <nas> gives me a random number
[18:41:39] <Tom_itx> printf("The hexadecimal value of smallval is %" PRIx8
[18:41:39] <Tom_itx> ", the decimal value of longval is %" PRId32 ".\n",
[18:41:39] <Tom_itx> smallval, longval);
[18:41:47] <Tom_itx> in inttypes.h
[18:42:02] <nas> k i got it
[18:42:18] <nas> i forgot to change scanf to also scan it as a lu
[18:42:22] <nas> works thanks
[20:28:17] <froggyman> Lt_Lemming: Any ideas? :P
[20:29:04] <froggyman> I want to setup a spectrum anaylzer with my AVR... any idea on a setup that wouldn't require purchasing an extra IC?
[20:29:28] <Lt_Lemming> what frequencies are you looking to target?
[20:29:58] <Lt_Lemming> because for it to be useful, the ADC you connect it too will need to be an order of magnitude faster than the target frequency
[20:32:14] <froggyman> Around 60, 180, 400, and 1K or around there
[20:32:30] <Lt_Lemming> 60Hz?
[20:32:40] <froggyman> yes
[20:32:56] <R0b0t1> I think that might work on the onboard ADC
[20:33:21] <froggyman> that's what I was hoping for
[20:33:30] <R0b0t1> You can overclock it quite a bit without losing resolution. Defaults were chosen as a compromise with power consumption.
[20:33:44] <R0b0t1> (if you need to do that)
[20:33:44] <R0b0t1> go ahead and try
[20:34:28] <froggyman> R0b0t1: but now I how do I separate those frequencies from an audio source into something readable by an AVR ?
[20:34:39] <R0b0t1> ..
[20:34:41] <R0b0t1> Well
[20:34:43] <R0b0t1> you do a FFT
[20:34:54] <R0b0t1> which you will not be able to do on an AVR
[20:35:05] <R0b0t1> But the AVR can get you the data
[20:36:30] <froggyman> interesting. What does the FFT?
[20:38:56] <R0b0t1> Probably a computer
[20:39:00] <R0b0t1> or a beefy uC
[20:39:36] <R0b0t1> I mean if you need FFT, or more specifically, the frequency components of an incoming signal, you're gonna have to resign yourself to adding some horsepower to your application
[20:42:00] * froggyman thinks he'll just go with one of these: MSGEQ7
[20:42:00] <froggyman> https://www.sparkfun.com/products/10468
[20:45:38] <R0b0t1> froggyman: How handy.
[20:45:39] <R0b0t1> srsly
[20:46:21] <froggyman> I was hoping something with discrete components (resisters, inductors and capacitors) would be possible, since those are all I have on hand ATM
[20:46:36] <froggyman> and was looking for something to add to me LED cube
[20:49:38] * froggyman wonders if something could get setup with his FPGA dev board
[21:21:33] <iSaleK> Does anyone have a DIY RFID reader circuit design? Without using expensive RFID modules...
[21:23:40] <Tom_itx> http://hackaday.com/2010/04/19/build-your-own-rfid-reader/
[21:23:42] <Tom_itx> http://playground.arduino.cc/Main/DIYRFIDReader
[21:23:57] <Tom_itx> http://blog.makezine.com/2010/03/15/diy-iphone-rfid-reader/
[21:24:28] <iSaleK> Thank you :)
[22:51:18] <nas_> wondering if there is anyway to see the commands the makefile is using?
[22:52:31] <Tom_itx> look in the makefile?
[22:53:41] <R0b0t1> well I'll be damned
[22:59:00] <froggyman> Thinking?
[22:59:07] <froggyman> Why not zoidberg!
[23:03:02] <nas_> is it possible to copmile by hand
[23:04:25] <nas_> id like to know what it would look like
[23:04:34] <dunz0r> nas_: If by hand you mean call your compiler, yes.
[23:05:06] <nas_> ive been staring at the makefile and its hard to know what its doing
[23:05:33] <nas_> it looks like its running scripts
[23:06:57] <dunz0r> nas_: It runs what you tell it to. Post your makefile on some pasteservice and I'll tell you what it does.
[23:08:54] <nas_> http://pastebin.com/Ff451Td0
[23:10:04] <nas_> /usr/lib/gcc/avr/4.7.0/../../../avr/include/avr/iom8.h
[23:10:10] <nas_> it somehow knows to include that
[23:10:39] <nas_> and also i noticed different versions of libc
[23:11:13] <nas_> avr3 avr4 avr5
[23:11:20] <nas_> it knows to somehow use avr4
[23:12:05] <nas_> id like to see an example of compiling it from the command line
[23:12:28] <nas_> i just have no clue wtf its doing in the background
[23:12:42] <Tom_itx> are you running studio?
[23:12:55] <nas_> nope
[23:14:48] <nas_> just make and avr-gcc
[23:33:11] <dunz0r> nas_: Look at line 999.
[23:33:54] <dunz0r> And line 635
[23:34:00] <dunz0r> That's a monster of a makefile btw...
[23:34:23] <nas_> ya its fscked
[23:35:25] <dunz0r> Here's my makefile, it's a bit simpler http://git.hax0r.se/?p=AVR/.git;a=blob_plain;f=Blink/Makefile;h=e1b724d4dfcc0794b22ae9c3eabeab943af4b9df;hb=HEAD
[23:36:06] <nas_> lol that looks a bit nicer
[23:36:23] <dunz0r> You have to add the source you want to build yourself though.
[23:36:50] <dunz0r> nas_: That's an old version btw... this is more recent: http://git.hax0r.se/?p=AVR/.git;a=blob_plain;f=MiniSumo_2012/Makefile;h=76a82fcc6b9a253a8a1cb3f217eafb45e6d75f2f;hb=HEAD
[23:36:59] <dunz0r> Look at the line saying SRC there.
[23:40:30] <nas_> you dont use PRINTF?
[23:40:51] <dunz0r> Nope.
[23:43:09] <nas_> i think ill rip off your makefile the one im using is bloated
[23:44:32] <dunz0r> Go ahead, it surely does the job at least :)
[23:45:26] <froggyman> nas_: this package includes a program called Mfile for AVR makefiles: http://sourceforge.net/projects/winavr/files/WinAVR/20100110/
[23:45:39] <froggyman> it's what I use for my makefile needs
[23:51:00] <dunz0r> Oh. Mfile's neat too.
[23:57:52] <slidercrank> I'm trying to reproduce a mono 8kHz wav-file on a speaker using 8bit PWM. I connected it via a resistor only (no capacitor, no amplifier).
[23:57:53] <slidercrank> The uC is clocked at 16MHz. Timer0 runs @ 8kHz, Timer1 is configured in 8bit PWM mode.
[23:57:53] <slidercrank> On each timer0 interrupt, I read a next sample and put it to OCR1A. But what I hear is noise rather than distinguishable original audio data. Could anybody tell what might be wrong?