#avr | Logs for 2015-01-10

Back
[03:44:41] <anonnumberanon> http://www.nasa.gov/multimedia/nasatv/#.VLDtEYdXaFY
[03:44:49] <anonnumberanon> launch
[03:44:53] <anonnumberanon> 20 minutes
[07:19:17] <tommylommykins> ohai
[07:19:47] <tommylommykins> im looking for advice on choosingnan avr simulator for
[07:19:51] <tommylommykins> linux
[07:20:04] <Jartza> what you need the simulator for?
[07:20:08] <tommylommykins> there seem to be a few around
[07:20:27] <Jartza> sure
[07:20:30] <Jartza> https://github.com/buserror/simavr
[07:20:42] <Jartza> that's my weapon of choice
[07:21:06] <tommylommykins> just debugging and confidence checking on a hobby project
[07:21:32] <tommylommykins> I'm currently using the UART output on the 328p chip on my arduino
[07:21:54] <tommylommykins> but I've got it set up so that it blocks execution when it outputs something big
[07:21:57] <Jartza> I like the integration with gtkwave, so the simulator also works like "logic analyzer"
[07:22:20] <Jartza> and simavr is easily extendable
[07:22:20] <tommylommykins> and that messes up scheduling
[07:23:01] <tommylommykins> I do a lot of FPGA simulation at work
[07:23:34] <tommylommykins> so I'm pelnty used to staring at digital waveforms :D
[07:32:23] <Lambda-Aurigae> simulation for something as simple as an avr...bah...hehe
[07:36:43] <tommylommykins> heh, as someone who works professionally with FPGAs, having to pause execution do deal with interrupts
[07:37:01] <tommylommykins> and not being able to know how long my code will take to run
[07:37:07] <tommylommykins> look pretty scary to me
[07:38:31] <Lambda-Aurigae> every command has a set number of clock cycles to execute.
[07:39:06] <Lambda-Aurigae> I can see if you are doing some real time critical stuff like VGA generation or such.
[07:39:21] <Lambda-Aurigae> but then you probably want to do JTAG or debugwire on the real hardware.
[07:39:39] <tommylommykins> yeah, I know it's pointless worrying on my part
[07:40:17] <Lambda-Aurigae> never done anything with FPGAs myself but have been programming small microprocessors and microcontrollers for many years starting back in the early 80s.
[07:43:20] <tommylommykins> mmm, with FPGAs, you get can calculate exactly how many cycles some functionality will take to execute just by reading the high level source code
[07:43:30] <Lambda-Aurigae> with avr you have to read the low level source code.
[07:43:37] <tommylommykins> and you can do everything at once, so "am I going to run out of time to do this" is not really a concern
[07:43:57] <tommylommykins> admittedly, I'm never going to run out of time with what I'm doing atm
[07:44:22] <Lambda-Aurigae> most of what people do on AVR is far from time critical and they usually have lots of extra time.
[07:45:45] <Lambda-Aurigae> simavr should work for you if you can figure out how to use it.
[07:48:38] <Lambda-Aurigae> but just like FPGA, understanding how the hardware works is your first line of offense.
[07:54:28] <twnqx> i am running out of time on my avr every now and then :P
[09:12:08] <Lambda-Aurigae> twnqx, I do too sometimes. That's when I move something off to a second chip usually,,,or overclock.
[09:24:54] <Tom_itx> i simulate in real hardware.
[09:28:53] <Steffanx> and debug using leds?
[09:30:44] <Tom_itx> no, i took the lid off and watch the bits change on the wafer
[09:31:43] <Tom_itx> you know, there's some guy in a lab coat in a clean room somewhere that has done that...
[09:33:09] <Tom_itx> Steffanx, what you been up to?
[09:33:44] <Steffanx> not so much.. and you??
[09:34:00] <Tom_itx> not alot. working on my cnc control a bit again
[09:34:28] <mulvane> Tom Random question... I bought a programmer off you about 2 years ago...Is there a bug in win 8.1 with them you are aware of? I haven't been able to succesfully burn a program to a chip with since I started trying to use it again this week.
[09:34:43] <Tom_itx> i'm not aware of one
[09:34:58] <Tom_itx> i know one guy at least that has used his there
[09:35:08] <Tom_itx> he did struggle a bit to get it to work right though
[09:35:10] <mulvane> Grrr... Then I am starting to wonder if the board went bad.. I'll have to check the traces.
[09:35:18] <Tom_itx> driver install i believe
[09:35:29] <mulvane> I see it in device manager.
[09:35:31] <Tom_itx> i can't recall. i don't have 8 to test on or i would
[09:35:52] <Tom_itx> what messages do you see if any?
[09:36:11] <Tom_itx> it's not bad if it's in the device manager
[09:36:17] <Tom_itx> at least not the usb side
[09:36:40] <mulvane> avrdude.exe: stk500v2_recv_mk2: error in USB receive
[09:36:48] <Tom_itx> oh
[09:36:52] <Tom_itx> in windows?
[09:36:58] <mulvane> Yeah.. using avrdude
[09:37:29] <Tom_itx> there's a bug with the usb driver in windows. you need to swap the firmware and make sure the jungo driver is unloaded and load the libusb one
[09:37:47] <Tom_itx> i'm not sure about the libusb driver on a 64bit machine
[09:38:06] <mulvane> I can do it in a VM with usb passthrough if required.
[09:38:13] <Tom_itx> there are 2 separate firmwares for my programmer JUST for windows and JUST for this problem
[09:38:21] <mulvane> Have a link?
[09:38:24] <Tom_itx> yep
[09:38:51] <Tom_itx> have you changed the firmware at all yet?
[09:39:09] <mulvane> I've got some 328s with optiboot on them and I just want to blank them and reset the fuses to use the internal oscillator..
[09:39:12] <mulvane> I have not.
[09:39:20] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[09:39:22] <Tom_itx> at the bottom
[09:39:34] <Tom_itx> use the 13-10-27 one
[09:39:51] <mulvane> I tried getting on your page a few days ago and it wasn't working. Now it does.. Perfect.
[09:39:53] <Tom_itx> and load the avrdude-5.10 version
[09:40:29] <mulvane> awesome.. Thanks.
[09:40:32] <Tom_itx> get FLIP to load it and follow the instructions here: http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_User_manual_index.php
[09:40:59] <Tom_itx> the first hex file on the list is the default windows one that's on it right now
[09:42:00] <Tom_itx> if you switch back to using studion you will need to reload it and make darn sure the jungo drive is loaded and sees the programmer
[09:42:12] <mulvane> Don't plan on using studio.
[09:42:13] <Tom_itx> that can be a BIG PITA sometimes to get back
[09:42:23] <Tom_itx> ok
[09:42:29] <Tom_itx> it should work fine
[09:43:07] <Tom_itx> does hardware show the libusb driver?
[09:43:17] <mulvane> If I was going that route, I'd order a second programmer I think.
[09:43:25] <mulvane> Yeah, I see the driver.
[09:43:43] <Tom_itx> you will need to load the driver for FLIP as well
[09:43:49] <Tom_itx> it's in the FLIP directory
[09:43:50] <Lambda-Aurigae> Tom_itx's unit works great with linux and avrdude...64 or 32 bit
[09:44:05] <mulvane> I know it used to work in FreeBSD awesomely.
[09:44:12] <Tom_itx> yeah, it takes a bit sometimes to get the drivers ironed out
[09:44:14] <mulvane> I just haven't done any avr dev in awhile
[09:44:42] <Lambda-Aurigae> I avoid windows whenever possible.
[09:45:07] <mulvane> I avoid linux whenever possible :-)
[09:45:19] <Lambda-Aurigae> hehe
[09:45:21] <Lambda-Aurigae> for me it just works.
[09:45:21] <mulvane> My 1PB data array is on freebsd :-)
[09:45:30] <Lambda-Aurigae> bsd rocks too.
[09:45:39] <mulvane> I just don't like the "My way or the highway" and messy base system.
[09:45:44] <mulvane> But I love unix.
[09:45:58] <Lambda-Aurigae> unix and unix derivatives rock.
[09:46:00] <mulvane> I use windows mainly to stay familiar..It's in my job description
[09:46:12] <Lambda-Aurigae> I use windows for work.
[09:46:28] <Lambda-Aurigae> have to because the xerox manuals are integrated to exploder.
[09:46:37] <mulvane> I'm the senior vmware engineer where I work...On an all windows network.
[09:46:47] <Tom_itx> i use whatever gets the job done
[09:46:56] <Lambda-Aurigae> I'm lead analyst/technician for a xerox company.
[09:46:58] <Jartza> hmmh
[09:47:00] <Jartza> okay
[09:47:09] <Lambda-Aurigae> and, yeah, whatever gets the job done.
[09:47:10] <mulvane> I still use os/2 warp at times :-P
[09:47:16] <Lambda-Aurigae> haha.
[09:47:16] <Tom_itx> running 3 windows version, DOS and 3 linux versions
[09:47:19] <Jartza> seems the attiny88 problem was actually avrdude problem
[09:47:19] <Lambda-Aurigae> I remember warp.
[09:47:45] <Lambda-Aurigae> remember a sales dweeb told me nothing would lock it up...it kept all programs separate and all that.
[09:47:45] <Jartza> there seems to be some undocumented fuse bits in efuse
[09:48:03] <Lambda-Aurigae> so I gave him a game from my old dos 3.1 days....
[09:48:05] <mulvane> You'd think as a former submarine cryptotech, I could get a job that doesn't use windows.....
[09:48:06] <Lambda-Aurigae> locked the thing hard.
[09:48:23] <Lambda-Aurigae> to the point where he had to pull the battery to reset the laptop
[09:48:40] <Jartza> and the avrdude had out-flag for 3 bits, but in-flag for only one
[09:48:51] <Lambda-Aurigae> Jartza, oops.
[09:49:10] <Tom_itx> mulvane, btw, which ver programmer do you have?
[09:49:15] <Lambda-Aurigae> Jartza, the attiny88 that much cheaper than the atmega88?
[09:49:23] <Tom_itx> it doesn't matter... just wondered
[09:49:38] <Jartza> Lambda-Aurigae: yes, about 0.5€
[09:49:45] <Tom_itx> it should have a rev on the silk somewhere
[09:49:59] <mulvane> And attiny is often just right size
[09:50:05] <Lambda-Aurigae> hmmm..yeah..looks like it's about twice the price.
[09:50:20] <Lambda-Aurigae> mulvane, the attiny88 is the same physical size as the atmega88
[09:50:36] <mulvane> Never used a mega88
[09:50:44] <Jartza> and atmega is missing for example pin change interrupts
[09:50:54] <Tom_itx> 88 is better than the 8 and cheaper
[09:50:55] <Lambda-Aurigae> Jartza, I thought the mega88 had pci.
[09:51:22] <Jartza> oh, might be it was mega8 that didn't
[09:51:26] <Lambda-Aurigae> yeah.
[09:51:36] <Lambda-Aurigae> 88 is the upgraded core with pci and qtouch
[09:51:44] <Jartza> too many models to remember them all :)
[09:52:12] <Jartza> tiny88 also has spi and i2c, real one, not usi
[09:52:33] <Lambda-Aurigae> yeah...
[09:52:37] <Lambda-Aurigae> that it has over other tinys.
[09:53:02] <Jartza> real uart is still missing though
[09:53:06] <Lambda-Aurigae> yeah.
[09:53:14] <Lambda-Aurigae> mega88 has all that
[09:53:18] <Lambda-Aurigae> and more sram
[09:53:28] <Jartza> yup
[09:53:28] <Lambda-Aurigae> but I can see a use for a cheaper version.
[09:54:06] <newio> does the tiny88 have the 16mhz rc, like the 85?
[09:54:23] <Lambda-Aurigae> don't think so...it only goes to 12MHz officially.
[09:54:38] <newio> :-( that would have been nice for v-usb
[09:54:56] <Lambda-Aurigae> dangit, I wish atmel would put out a hardware usb chip in dip package...
[09:55:12] <Lambda-Aurigae> and the pll/high speed rc oscillator would be nice in an atmega too.
[09:55:30] <Lambda-Aurigae> would remove my last reason for using pic18 series chips.
[09:55:36] <newio> yep...
[09:55:47] <Jartza> nicely attiny85 has 64MHz pll
[09:56:03] <Lambda-Aurigae> pic18f45k50 can do full speed usb in hardware without an external crystal.
[09:56:46] <Lambda-Aurigae> and no external voltage regulator...can run right from usb power.
[09:56:49] <Jartza> Lambda-Aurigae: btw, last time I checked, atmega88 price was tiny88 times 3
[09:56:54] <Lambda-Aurigae> that's one series they did right.
[09:57:31] <Lambda-Aurigae> Jartza, yeah... $1.27 usd for t88 and $4.50 usd for m88
[09:57:34] <Lambda-Aurigae> from digikey.
[09:57:37] <Lambda-Aurigae> 4.56
[09:58:17] <Jartza> oh, I buy from mouser usually, last time 100 t88s were something like 58€
[09:58:19] <Lambda-Aurigae> wonder if I can get atmel to send me some t88 samples...
[09:58:31] <Jartza> why not
[09:58:43] <Lambda-Aurigae> yeah...they go way down at 100 quantity... 0.89 usd each in 100.
[09:58:44] <Jartza> I even got 5 samples :)
[09:59:07] <Lambda-Aurigae> I've had good luck with atmel samples here...no so good out east.
[09:59:20] <Lambda-Aurigae> at least, after my rep changed.
[10:00:09] <Jartza> well, I just requested samples by email and added "btw. have you seen my attiny audio 'modem' article?"
[10:00:18] <Lambda-Aurigae> hehe.
[10:00:30] <Jartza> got 5 tiny88s and 5 xmega32u4s
[10:01:20] <Lambda-Aurigae> people keep telling me I should blog about my teaching experiences.
[10:01:25] <Jartza> xmega I really needed to test for customer product, tiny88 was for my own stuff :D
[10:01:35] <Jartza> Lambda-Aurigae: sure!
[10:01:52] <Lambda-Aurigae> I just don't do well with "blogging"
[10:02:16] <Jartza> that one blog post has had 15k unique readers already
[10:02:28] <Jartza> and 45k views
[10:02:31] <Lambda-Aurigae> it is a nice bit of work.
[10:02:57] <Jartza> and I first thought "maybe 5 nerds are interested" :D
[10:03:02] <Lambda-Aurigae> hehe.
[10:03:10] <Lambda-Aurigae> naa...10 or 12 at least.
[10:03:18] <Lambda-Aurigae> you know we all have multiple IPs to look at things.
[10:03:31] <Jartza> but then decided that if it's helpful to 5 people, why not
[10:03:58] <Lambda-Aurigae> I downloaded it but haven't tried it yet.
[10:03:58] <Jartza> Lambda-Aurigae: sure, it's not iå-based tracking
[10:04:27] <Jartza> we measure using google
[10:04:50] <Jartza> what's that... analytics
[10:05:02] <Lambda-Aurigae> yeah.
[10:05:18] <Jartza> I'm going to try it on attiny88 next
[10:05:52] <Lambda-Aurigae> if I get time to play with something new I might try to shove it onto a couple of atmega1284p chips.
[10:23:01] <Tetouani63> Hi all. Is There people working with ATmega128rfa1 ?
[10:35:44] <Lambda-Aurigae> there probably are.
[10:35:49] <Lambda-Aurigae> don't hear about it much here though.
[10:44:01] <Jartza> Lambda-Aurigae: would be nice to know how it works on atmega :)
[10:48:01] <Jartza> I might try it on xmega, but currently I have no atmegas to try on
[10:59:38] <Aer93> hi, I'm trying to use the USART of a ATMega2560. The thing is that when I restart it send things that were loaded from the last run time...
[11:00:05] <Aer93> is there a way to clear the USART so when I initialize it I also clear it?
[11:05:55] <Aer93> any idea?
[11:07:41] <specing> idk, can't you access the shift register directly?
[11:07:46] <Tetouani63> maybe by reading the USART buffer until it will be empty
[13:25:18] <malinus> Aer93: shouldn't the buffer be empty after the restart? I'm pretty sure it is?
[14:01:15] <Lambda-Aurigae> malinus, Aer93, what kind of restart?
[14:02:47] <Lambda-Aurigae> Aer93, or is it your terminal program or whatever is receiving is waiting for some end of line or something to display the data and not getting it until you start up sending data again?
[14:06:37] <Lambda-Aurigae> how much data appears to be sent after restart? Because the hardware buffer is all of one(1) byte.
[15:03:57] <tommylommykins> Ooh! Quick question.. Will avr-gcc correctly read and write to the AVR 16 bit registers? I din't have to write asm to read/write TCNT1, for example?
[15:05:18] <Lambda-Aurigae> just write the registers 8 bits at a time, high then low as I recall.
[15:07:10] <Lambda-Aurigae> apparently you can access them directly via TCNT1= 0xXXXX
[15:07:14] <Lambda-Aurigae> in C.
[15:07:40] <tommylommykins> and that will compile correctly in AVR-GCC?
[15:08:02] <Lambda-Aurigae> probably...that's how they do it in the avr datasheets.
[15:08:17] <Lambda-Aurigae> and, looking back, that's how I've always done it.
[15:09:04] <tommylommykins> OK, I shall trust it to be correct :D
[15:09:10] <tommylommykins> Thanks :D
[15:10:03] <Roklobsta> Have a look at how read/write of TCNT1 is implemented, I think as a macro.
[15:13:22] <Lambda-Aurigae> http://www.pceworld.com/tags/gcc-pedantic/674 search for Preambula...about 3/4 down the page.
[15:13:44] <Lambda-Aurigae> which says it works.
[15:13:49] <Lambda-Aurigae> just one of several I found.
[15:17:02] <tommylommykins> Thanks again :)
[17:05:04] <mulvane> Anyone know flags I should pass to avrdude to erase chip and set all fuses to default on a mega328?
[17:05:24] <LeoNerd> -e do to a chip erase but that wont' reset the fuses
[17:05:44] <LeoNerd> To do the fuses you'll have to look up the default values yourself and do some -U lfuse:... -U hfuse:... -U efuse:... operations
[17:07:26] <mulvane> Just found this http://eleccelerator.com/fusecalc/fusecalc.php?chip=atmega328p
[17:13:13] <Lambda-Aurigae> http://www.engbedded.com/fusecalc/
[17:13:16] <Lambda-Aurigae> that works too.
[17:14:11] <Lambda-Aurigae> either one gives you avrdude commands.
[17:45:51] <LeoNerd> GAHHH
[17:46:19] <LeoNerd> Spent ages debugging electrical connections, source code, ... got my logic probe out. In the end: the difference was avrdude -b RATE vs. avrdude -B RATE
[17:46:41] <Lambda-Aurigae> oops
[17:48:52] <Tom_itx> mulvane did you get it working?
[17:59:38] <Lambda-Aurigae> welcome back Aer93
[18:08:26] <Jartza> evening
[18:09:05] <Lambda-Aurigae> morning Jartza
[18:33:14] <Jartza> well. night all :D
[18:41:47] <LeoNerd> I want to output a single byte over "SPI", to drive a '595 to set some LEDs. I'm already dual-using the MOSI/SCK lines for other things as general GPIO. Should I bother using the SPI module at all, or just bitbang those myself?
[18:41:56] * LeoNerd wonders what uses less program space
[18:57:36] <mulvane> Tom Actually no.
[18:58:01] <mulvane> I have flip running, I go to select the chip, and then connect. Says it can't open usb device.
[18:58:32] <mulvane> I have a 1.1b board.
[19:03:00] <mulvane> When I put it into program mode, it doesn't recognize in windows right.
[19:08:42] <Lambda-Aurigae> LeoNerd, probably just as easy to bitbang it as to fake the spi hardware into dealing with it.
[19:12:00] <LeoNerd> Actually, using the SPI hardware does seem rather short and efficient. I think I'll do that
[19:35:16] <mulvane> I believe its a win 8 issue.
[19:46:54] <hackvana> inflex: Hi
[19:48:04] <inflex> morn
[19:48:16] <hackvana> I wish
[19:48:31] <inflex> It's all times all over the world :)
[19:48:46] <hackvana> The only way it's morning for me: http://www.total-knowledge.com/~ilya/mips/ugt.html
[20:03:56] <hackvana> s.
[20:15:35] <RossMcK_> afternoon all
[21:05:42] <Tom_itx> mulvane, which chip are you selecting? early boards used the at90usb162
[21:05:50] <Tom_itx> later ones used the atmega32U2
[21:07:09] <Tom_itx> also you may have to 'force' select the FLIP usb driver when it's installed
[21:25:52] <mulvane> Thats what I selected. I'm installed win7 in a VM to see if that helps.
[21:26:23] <mulvane> force?
[21:36:09] <Tom_itx> tell it what driver you want
[21:36:12] <Tom_itx> don't let it pick
[23:33:55] <mulvane> Got it to work...
[23:34:06] <mulvane> Had to install a libusb driver for both modes..
[23:35:08] <Tom_itx> both modes?
[23:35:28] <mulvane> normal and program mode.
[23:35:29] <Tom_itx> you need one for FLIP and one for avrdude yes
[23:35:40] <Tom_itx> that's what i was telling you
[23:35:48] <mulvane> Ah..Ok.
[23:35:53] <Tom_itx> so the new firmware fixed it?
[23:35:56] <mulvane> I must have been missing that.
[23:36:12] <mulvane> I haven't tested that yet. I have 4 kids keeping me busy and distracted.
[23:36:43] <Tom_itx> well, it should...