#avr | Logs for 2014-05-15

Back
[04:31:32] <AllinYourhead> i have problem with AS6, AVR Dragon and ATmega328p. I can't disable debugWire because the fuse is set so ISP not accessable and when i try to start the debugging session i get error: Target synchronisation failed. Debugger command setParameter failed.
[04:33:33] <superware> I'm trying to setup SPI between ATmega328P and ATtiny2313 http://pastebin.com/yjy37Fd7 the output I'm getting from the master is: 0x55-11-22-33-55-55-55-55-55-55... instead of 0x55-11-22-33-55-11-22-33... any ideas?
[04:41:09] <superware> anyone please?
[05:11:20] <RattusRattus> AllinYourhead: if the ISP bit has been cleared and your programming method is ISP then I am afraid that you will need to use an alternative programming method & programmer (if you have one available) or simply change the MCU to a new one.
[05:11:53] <megal0maniac> The alternative programming method is HVPP which is supported by the AVR Dragon
[05:12:14] <AllinYourhead> HVPP didn't work either, got a different error there
[05:12:50] <AllinYourhead> found bug report from earlier this year with same issue, also unanswered by Atmel http://asf.atmel.com/bugzilla/show_bug.cgi?id=3313
[05:12:52] <megal0maniac> Then you hooked it up incorrectly or your atmega is dead
[05:13:22] <AllinYourhead> ah so the HVPP is different pin setting for programming?
[05:13:31] <megal0maniac> AllinYourhead: Very
[05:13:50] <AllinYourhead> ah ye i c
[05:14:42] <megal0maniac> http://www.atmel.no/webdoc/avrdragon/avrdragon.SCKT3200A2.html
[05:14:58] <AllinYourhead> doesn't seem like an alternative to me since the unit is mounted on a device. The assembly factory will have to replace it then i guess
[05:16:18] <megal0maniac> The Dragon should be able to disable debugwire automatically though
[05:17:00] <megal0maniac> RikusW has a programmer which integrates that feature. Just add a 10K resistor and it will temporarily unset the DWEN fuse when you use ISP
[05:17:01] <AllinYourhead> it can't read through ISP when the fuse it set and AS6 doesn't let me start the debugging session from where I have the alternative to "disable debugWire and close"
[05:17:45] <AllinYourhead> any link to that solution?
[05:19:19] <megal0maniac> Just make sure all the lines are connected, and that there isn't a capacitor on reset
[05:21:31] <AllinYourhead> 10k resiston on the reset line between MCU and ISP from dragon?
[05:22:11] <megal0maniac> Should be able to leave the resistor out
[05:23:07] <RattusRattus> superware add case 0x55: directly below your case 0x01: line in your slave code
[05:24:11] <superware> RattusRattus: why?
[05:24:56] <superware> RattusRattus: the master only sends 0x01 and 0x00
[05:25:23] <RattusRattus> because other than the initial loop slave will never recieve 0x01
[05:26:42] <superware> that's what I don't understand, why only the initial loop?
[05:29:57] <superware> why should the slave receive 0x55?
[05:30:00] <RattusRattus> well you only display what is recieved from the slave every 4th byte. (hint look at what you get back after each 0x00 transfer and you will see that you are out of sync)
[05:31:15] <superware> I'm seeing every uart_put_char(spi_transfer(0))
[05:32:27] <RattusRattus> superware: NO you are not. uart_put_chat(t) only happens after you send 0x01
[05:33:04] <superware> can't you see three uart_put_char(spi_transfer(0)); ?
[05:33:24] <superware> :)
[05:33:52] <RattusRattus> yes but you are only looking at every 4th transfer --> if(t ==0x55)
[05:34:34] <superware> I'm getting something like: 0x55-11-22-33 -delay- 0x55-55-55-55 -delay- 0x55-55-55-55...
[05:35:42] <superware> ok, but why it's getting out of sync?
[05:35:55] <superware> it's=is it
[05:36:34] <RattusRattus> thinking....
[05:36:47] <superware> according to you I should get: 0x55-11-22-33 -delay- 0x55 -delay- 0x55 -delay-...
[05:38:00] <superware> since 0x55 is 0b01010101, I've also tried 0x75 :) in case the USI-SPI bits aren't aligned... but then I get 0x75 instead of 0x55
[05:38:39] <superware> superstrange
[05:40:01] <superware> the connectios are direct MOSI-DI MISO-DO SCK-SCL
[05:40:14] <superware> both 20Mhz
[05:42:55] <superware> RattusRattus: maybe it has something to do with SPI mode (0-3)? ATmega328 CPOL/CPHA
[05:43:08] <AllinYourhead> is BOD enabled by default in an ATmega328p? BOD fuse not set.
[05:43:26] <superware> see defaults here http://www.engbedded.com/fusecalc
[05:44:25] <superware> RattusRattus: any ideas? :|
[05:46:38] <RattusRattus> ok my bad.... /me barking up wrong tree
[05:50:06] <superware> what can it be?
[05:52:10] <RattusRattus> it has me intreaged. I don't know so am building up a test rig here....
[05:53:35] <superware> wow, thats great, thanks
[05:54:33] <RattusRattus> superware: silly question are both units running at same clock speed?
[05:56:15] <superware> yep, 20Mhz
[05:57:01] <superware> the master SPI prescalar is 128 anyway
[05:57:59] <RattusRattus> indeed but if the slave was running much slower than master....
[05:58:07] <superware> yea
[05:58:21] <RattusRattus> but it is NOT that
[05:59:02] <RattusRattus> not gonna be able to look at this in the office (only have 1 avr to play with) so will look at home this evening where I have a few boards to play with
[05:59:51] <superware> :( thanks anyway
[06:00:25] <superware> since there's no SS, maybe the slave is slow to respond?
[06:05:08] <superware> RattusRattus: the slave clearly enters case 0x01 only once
[06:06:55] <RattusRattus> yes
[06:07:33] <RattusRattus> that I could see. I am sure we are out of sync somehow, I just can't see why
[06:08:33] <superware> maybe... the slave stays in while (!(USISR & _BV(USIOIF))); because it only got 7 bits
[06:11:42] <RattusRattus> confirm that by not starting next master send loop without a key press...
[06:13:46] <superware> I can simply turn on a led before the while, and turn it off afterwards
[06:15:02] <superware> no... it can't be since the master IS getting the right data from the slave (I now have the slave count up and send it to the master, and it works)
[06:16:07] <superware> the master is recieving 0x00 to 0xFF
[06:24:36] <RattusRattus> if I understand correctly your count code works just fine, but previous code didn't do what you expect. that at least proves that your SPI code is functioning correctly and that the bug must therfore be in the higher level logic!
[06:26:55] <malinus> somebody from in here were hacking a webcam, does anyone happen to know who it was?
[06:27:09] <megal0maniac> malinus: One sec
[06:27:54] <megal0maniac> 2014-05-13.log:03:18 < Lambda_Aurigae> thinking of ripping apart one of my older webcams and trying to interface the camera to the AVR.
[06:27:57] <megal0maniac> That one?
[06:28:08] <superware> RattusRattus: I guess, I'm with this for days now :|
[06:28:18] <malinus> nice to have someone with logs, thanks megal0maniac
[06:28:29] * megal0maniac <3 grep
[06:28:40] <Lambda_Aurigae> xchat logs and grep are a wonderful thing.
[06:28:51] <megal0maniac> Pah! xchat
[06:29:00] <megal0maniac> I use irssi, like a real man
[06:29:02] <malinus> irssi?
[06:29:04] * megal0maniac runs
[06:29:09] <Lambda_Aurigae> well, if I was only on one chat I would just use telnet.
[06:29:10] <Lambda_Aurigae> but,,
[06:29:12] <malinus> ah yes, could have guessed ;)
[06:29:29] <Lambda_Aurigae> suppose I could fire up bitchX
[06:29:40] <Lambda_Aurigae> that's just slightly better than telnet for irc.
[06:29:44] <malinus> wait, people use X?
[06:29:55] <malinus> what for, just bloat
[06:30:13] <malinus> you have screen/tmux ;)
[06:30:15] <megal0maniac> Lambda_Aurigae: Telnet?
[06:30:32] <megal0maniac> Yeah, irssi > screen > ssh
[06:30:34] <Lambda_Aurigae> yeah...you can telnet to the irc server and respond to everything manually.
[06:31:05] <megal0maniac> Oh lol
[06:31:12] <megal0maniac> Like that...
[06:31:19] <malinus> wait you guys don't do that?
[06:31:28] <malinus> I'm always staring on the screen waiting to pong back
[06:31:28] <Lambda_Aurigae> only sometimes malcom2073
[06:31:37] <Lambda_Aurigae> err
[06:31:38] <Lambda_Aurigae> malinus,
[06:31:46] <malinus> I can only take 2min baths
[06:31:48] <megal0maniac> malcom2073: Yes, you
[06:31:57] <malinus> becauase I have to pong back to freenode
[06:32:25] <megal0maniac> malinus: /bin/sh
[06:32:36] <megal0maniac> And /etc/crontab
[06:32:45] <malinus> heh
[06:32:45] * RattusRattus uses screen/irssi
[06:32:59] <megal0maniac> I use Quassel
[06:33:04] <megal0maniac> JUST KIDDING GUYS!
[06:33:19] * RattusRattus puts down the flame thrower....
[06:34:21] <malinus> Lambda_Aurigae, insnpired by your idea, I've took apart a webcam (late 90's early 00's). And indeed I found a nice CCD-sensor chip that would probably be easy to work with. BUT everything is so small, smd everywhere, the chip is TQFP44 package :(. What do?
[06:34:47] <Lambda_Aurigae> solder on really tiny wires?
[06:34:53] <megal0maniac> Oh nice, tqfp44. You're lucky, could have been bga
[06:35:01] <megal0maniac> Or qfn
[06:36:22] <malinus> the datasheet http://www.alldatasheet.com/datasheet-pdf/pdf/24829/STMICROELECTRONICS/STV0502.html heh I was suprised to find it. (October 1998)
[06:38:13] <malcom2073> lol
[06:38:38] <superware> I'm trying to setup SPI between ATmega328P and ATtiny2313 http://pastebin.com/yjy37Fd7 but the output I'm getting from the master is: 0x55-11-22-33 delay 55-55-55-55 delay 55-55-55-55... instead of 55-11-22-33 delay 55-11-22-33... any idea?
[06:40:26] <Lambda_Aurigae> superware, can we see what data is actually on the lines?
[06:40:48] <superware> Lambda_Aurigae: no, only master UART
[06:40:56] <superware> and slave LEDs
[06:41:06] <Lambda_Aurigae> I meant by using a logic analyzer on the lines.
[06:41:13] <superware> yeah, I don't have one
[06:41:15] <Lambda_Aurigae> to see if the data is being sent properly or not.
[06:43:43] <superware> well, 0x55 is coming from the salve you know :)
[06:43:50] <superware> slave
[06:44:25] <Lambda_Aurigae> so the problem is in the logic on the receiving end.
[06:44:26] <superware> since the master is getting 0x11-22-33 only once at start, it means the slave is getting 0x01 only once
[06:45:26] <superware> might be, but the logic is very simple
[06:46:01] <Kev> superware you can get a great chinese knock off of a popular logic analyser for super cheap, it's a very handy tool to have
[06:46:36] <superware> I guess I'll have to, but I don't have one at the moment...
[06:47:50] <malinus> Kev, wouldn't it be better to buy a usb-scope?
[06:47:53] <Lambda_Aurigae> or,,,make one.
[06:47:59] <malinus> I'm kinda in the same situation
[06:48:23] <Lambda_Aurigae> logic shrimp is easy to build and works well up to 20mhz.
[06:48:45] <Lambda_Aurigae> and can be made from all through hole parts and can, with a bit of fiddling, be built on stripboard.
[06:48:46] <Kev> malcom2073 depends
[06:48:49] <Lambda_Aurigae> or veroboard.
[06:49:08] <Lambda_Aurigae> aaand, I'm off to work.
[06:49:13] <malcom2073> malinus: Us having the first three letters the same really messes with people's tab complete, doesn't it? :P
[06:49:30] <Kev> oups my bad
[06:49:33] <malinus> mal is pretty popular
[06:49:53] <superware> ok, I got it... should be USICR = _BV(USIWM0)|_BV(USICS0)|_BV(USICS1); and not USICR = _BV(USIWM0)|_BV(USICS0)|_BV(USICS1);
[06:49:54] <malinus> Kev, depends on what :)?
[06:50:14] <superware> thanks RattusRattus and Lambda_Aurigae
[06:50:53] <Kev> malcom2073 http://i.imgur.com/pkLyp09.png can't do that with a scope
[06:51:39] <superware> looks great
[06:51:41] <malinus> poor malcom2073
[06:52:04] <Kev> damnit malcom2073, i'm sorry :)
[06:52:23] <malcom2073> Lol np, after the first two I silenced notifications for this channel for the time being :P
[06:52:26] <malinus> Kev, well, can't you? I mean on one of those usb-scopes?
[06:53:29] <Kev> malinus well, depends how many chanels it has
[06:54:39] <Kev> a scope is usualy great for analog, and a logic analyser for digital
[06:55:00] <malinus> but I want both, cheap
[06:55:11] <Daulity> dx
[06:55:12] <Kev> also depending on the software it already "knows" spi and other protocols,
[06:55:56] <malinus> good thing I have a windows VM
[06:56:22] <Daulity> for example http://www.dx.com/p/usb-oscilloscope-and-logic-analyzer-93518#.U3SnIHKJr4c
[06:57:55] <malinus> Max. sampling rate up to 16MHz
[06:57:56] <malinus> uhh
[06:57:58] <malinus> :V
[06:59:48] <Daulity> it is just an example :)
[07:00:36] <Daulity> never ever buy this one http://www.dx.com/p/ds201-pro-2-8-color-tft-lcd-pocket-digital-oscilloscope-w-8mb-memory-black-252250#.U3SoL3KJr4c
[07:00:42] <Daulity> cause it's expensive and it suck
[07:01:33] <malinus> oh
[07:03:58] <malinus> Daulity, I like how you have to desolder some pins on the first example to make it not brick
[07:04:26] <malinus> if you power it on before doing that, it seems to erase the flash sometimes. Or so they say at least
[07:04:35] <Daulity> :D
[07:05:31] <Daulity> i myself have a logic 8 from here https://www.saleae.com/logic16?gclid=CJT96uLtrb4CFcPMtAod3WMACQ
[07:05:45] <Daulity> and that thing is not cheap
[07:06:04] <Daulity> but it is a really really really i can't say it enough good tool
[07:06:21] <NooM> logic analyzer?
[07:07:01] <Daulity> yes
[07:07:04] <Kev> Daulity i have the chinese version of the logic8, and it's cheap :D
[07:07:17] <NooM> the stm32f407 discovery board is good for that. its only 10$
[07:07:23] <Daulity> i want to give the maker of that thing all my money :D
[07:07:29] <NooM> and some guy wrote software for it
[07:07:40] <NooM> iirc its up to 20mhz sample rate
[07:07:44] <NooM> so all you need for avr
[07:17:27] <NooM> hm
[07:23:00] <malinus> NooM, that's a nice idea
[07:23:07] <NooM> ya
[07:23:10] <NooM> :D
[07:23:15] <NooM> and it does work
[07:23:50] <NooM> https://www.dropbox.com/s/jm44mooswq971yy/la_spi.png
[07:35:26] <RattusRattus> has anyone tried any of these? http://www.ebay.co.uk/itm/Portable-Mini-ARM-DSO203-Quad-4-Channel-ADC-FPGA-Digital-Oscilloscope-UK-/281167403719?pt=UK_BOI_Electrical_Test_Measurement_Equipment_ET&hash=item4176e21ac7 OK so they are not especilly fast but will probably do for just 'looking' at most signals in the hobby realm?
[07:37:14] * RattusRattus has a nice Tektronix 'scope he 'inherited' when a company he worked for went to the wall so I haven't needed to buy myself a good scope (and I shudder at the cost if I ever need to replace it £15k)
[07:42:45] <Tom_itx> rikol sp? seems to be a popular one
[08:22:36] <malinus> RattusRattus, very expensive though.
[08:22:57] <malinus> I mean, you can buy a real used digital scope for that price
[08:26:09] * RattusRattus hasn't seen a used DSO for £100 or less
[08:26:34] <RattusRattus> but if you can get them then yes that would be better
[09:33:28] <The_Coolest> ... @ noom
[09:33:38] <The_Coolest> expects a reply within a second
[09:36:49] <malinus> how different are the 32bit avr's?
[09:37:16] <malinus> in sense of how easy it is to manipulate the peripherals.
[09:52:38] <DanFrederiksen> RattusRattus, I think they are crap. get a rigol ds1052e
[09:56:17] <RattusRattus> DanFrederiksen: you are comparing the rigol ds1052e to a Tektronix MSO4104 (my scope?) really??
[09:56:38] <RattusRattus> or the littl pocket thing that I asked about?
[10:35:13] <DanFrederiksen> RattusRattus, the quad
[13:53:23] <Episilon_Aurigae> Greetins and shtuff.
[14:29:28] <_abc_> Does anyone know if the linux ft232 drivers used with arduino, avrdude etc., detect the fake ft232rls? See http://3.14.by/en/read/FTDI-FT232RL-real-vs-fake-supereal
[15:13:45] <megal0maniac> Someone halp. How do reduce power consumption on my laptop? http://imgur.com/PRIdPzO
[15:14:18] <megal0maniac> The government asked me to switch it off
[15:14:38] <megal0maniac> I think there may be some kind of black hole inside
[15:15:12] <GuShH> megal0maniac: contact lenovo :p
[15:15:18] <GuShH> my thinkpad idles at 7W
[15:16:13] <GuShH> some driver got buggered up
[15:16:31] <GuShH> there's a lib that communicates with the battery manager that handles that
[15:16:54] <GuShH> the power manager sucks anyway
[15:18:15] <megal0maniac> Not it says 4000000
[15:18:22] <GuShH> ...
[15:18:26] <megal0maniac> s/not/now
[15:18:36] <GuShH> it's just a software bug
[15:18:37] <megal0maniac> I'm restarting. This is making me uncomfortable
[15:18:40] <megal0maniac> I know :)
[15:19:34] <megal0maniac> But still
[15:19:55] <GuShH> now in reality the wattage displayed is not the real wattage consumed from the wall, because of inefficiencies on the smps, but it's ok that's more or less what it's drawing from the DC side.
[15:21:18] <megal0maniac> Of course. You can see if it's more/less relative to what it was
[15:23:20] <megal0maniac> 8W. Much better
[15:37:52] <_abc_> megal0maniac: Restart under linux. The bug may be called 'Windows'.
[15:38:06] <_abc_> I am not kidding, the same laptop consumes 20W under Linux and 80 under Windows.
[15:38:37] <megal0maniac> Haha! Buggy power drivers?
[15:43:05] <_abc_> No, indexing...
[15:43:52] <megal0maniac> Eugh..
[17:56:03] <nofxx> Little question, avr datasheets have fuse configuration for 1 to 8 mhz and another for 8 mhz + which one should i choose for 8 mhz crystal??
[17:58:02] <Tom_itx> high speed full swing crystal
[17:59:21] <Tom_itx> http://www.engbedded.com/fusecalc/
[17:59:26] <Tom_itx> that should help
[18:00:20] <nofxx> Tom_itx, thanks! yeah, I'm using that... it's just a lil confusing. Docs could say: 1.0 - 7.99Mhz, 8.0+
[19:58:34] <hjohnson> hrmm.. anyone here played with the event system on xmegas?
[19:59:06] <hjohnson> I'm debating whether I can use clkevent or whatever it is to generate a clock signal for one of the other ICs (rather than using an oscillator and routing a clock line)