#avr | Logs for 2013-03-04

Back
[05:00:12] <einball> Good morning guys
[05:06:51] <inductiveload> hello! I'm trying to get some inline assembly working on an XMEGA128A1 - it works on GCC 4.3.3 on Windows, but GCC 4.7.0 and 4.7.2 choke on impossible asm constraints. The constraints in question are : "M" (x >> 8), "M" (x & 0xff), where x is unsigned short. I've also tried to use "n" contraints.
[05:11:42] <inductiveload> however, when I used this at first, it worked, and after adding a couple more invocations, it stopped working
[05:30:18] <RikusW> andi will work
[05:30:36] <RikusW> but for & 0xFF you can just grab whole the byte
[05:30:41] <RikusW> *the while
[05:31:27] <RikusW> >> 8 can be done but moving whole bytes instead of actually shifting
[05:31:36] <RikusW> s/but/by
[05:32:48] <RikusW> afk
[05:34:05] <inductiveload> RikusW: "i" doesn't work either
[05:51:08] <RikusW> since using 8 bits just take whole bytes..
[05:54:13] <inductiveload> how do i do that for an incoming "unsigned short"?
[05:55:52] <RikusW> you could try using LDS
[05:56:02] <RikusW> afaik AVR is little endian
[05:56:15] <RikusW> so LDS r16,var
[05:56:21] <RikusW> LDS r17,var+1
[05:57:31] <RikusW> I used that in plain AVR asm
[06:01:55] <inductiveload> but how do I stop the "impossible constraint" error? seems whatever I put in there will fail
[06:03:35] <RikusW> avr libc docs does have a chapter on inline asm
[06:07:10] <inductiveload> sure, i read that, but I don't understand why all of "M" or "n" will sometimes refuse to take an bitwise-fiddled-with unsigned short argument and sometimes allow it
[06:07:54] <inductiveload> and why GCC 4.3.3 has no problems with it
[06:09:06] <RikusW> you could try using a union to solve the problem
[06:09:33] <RikusW> union { short struct { char char }}
[06:20:32] * inductiveload fiddles
[11:48:30] * RikusW "broke" his SIM900 modem :-P
[11:48:43] <Steffanx> poor him
[11:48:44] <RikusW> I uploaded custom firmware....
[11:48:54] <RikusW> fixed by now :)
[11:49:30] <RikusW> seems the stupid debug serial port buffers 4 bytes
[11:49:40] <RikusW> it won't send along single bytes :S
[11:49:48] <RikusW> and there is no timeout :(
[11:50:27] <RikusW> Steffanx: So I'm finally developing ARM code, seems there are like 64MB of flash in that module :)
[11:50:35] <Steffanx> :P
[11:50:43] <RikusW> it can be used for file storage as well
[11:51:11] <RikusW> there is a primitive inode system and root dir only named file system
[11:51:38] <RikusW> it runs at 156MHz or something :)
[11:52:13] <RikusW> and there is an Embedded AT API, looks very much like running it from another controller
[11:52:13] <Steffanx> jtagging it?
[11:52:20] <RikusW> no jtag :(
[11:52:27] <Steffanx> oh, just uarting :P
[11:52:30] <RikusW> only a debug serial port
[11:52:37] <RikusW> and the normal serial port
[11:53:13] <RikusW> I'm nearly finished on RPC like code that goes over the debug port
[11:53:31] <RikusW> will enable me to develop most of the code on a PC in VS :)
[11:54:33] <RikusW> it can even do FOTA (fw update over the air)
[11:55:02] <RikusW> very simple, just put the data in an inode file and call a function, and exit main()
[12:01:06] <Steffanx> That's how the updater does it?
[12:01:17] <Steffanx> Man, how you figure stuff like that out? :)
[12:03:29] <RikusW> I got a custom upload app from SIMCom
[12:03:55] <Steffanx> From them as in they sent it to you??
[12:04:10] <RikusW> yes
[12:04:20] <RikusW> after asking nicely multiple times...
[12:04:26] <Steffanx> And you reverse engineered it?
[12:04:34] <RikusW> they sent the cracked ARM compiler too :)
[12:04:43] <Steffanx> LOL
[12:04:46] <RikusW> fortunately didn't have to RE
[12:05:10] <RikusW> but it seems GCC could work too, they sent RVCT
[12:05:35] <RikusW> I will probably use their update function later to do a custom update protocol
[12:05:40] <RikusW> their app is win only...
[12:06:06] <RikusW> but if my upload fails, I'll have to use their app again...
[12:06:51] <Steffanx> Avond
[12:07:00] <RikusW> Seems you only get customer support if buying 1k + per month...
[12:07:01] <Steffanx> Make sure your app doesnt fail RikusW :P
[12:07:07] <RikusW> so I'm on my own...
[12:07:16] <RikusW> good idea :)
[12:07:38] <RikusW> the docs aren't too bad
[12:07:53] <megal0maniac> Or demonstrate what you've done with it
[12:07:58] <RikusW> but nothing documents the stupid 4 byte buffer on the debug port...
[12:08:20] <RikusW> my RPC debug code might earn me support ;)
[12:08:23] <megal0maniac> 4 byte is quite big..
[12:08:36] <RikusW> yes :(
[12:08:54] <RikusW> so you have to send 4 chars each time or receive nothing on the SIM900
[12:08:57] <Steffanx> So where is the problem?
[12:09:01] <Steffanx> ah
[12:09:39] <RikusW> sending 123 then 456 then 78 will result in receiving nothing, then 1234 then 5678
[12:09:47] <RikusW> irritating :S
[12:09:58] <Steffanx> Their app also does that all the time?
[12:10:07] <Steffanx> No fancy way around it?
[12:10:15] <RikusW> I use hyperterm...
[12:10:22] <RikusW> hacking their fw ?...
[12:10:30] <RikusW> the provide the raw binary
[12:10:39] <RikusW> and the symbols too :-P
[12:10:48] <RikusW> ALL their function names
[12:10:53] <RikusW> and addresses
[12:11:02] <RikusW> in a nice easy to read text file
[12:11:15] <RikusW> only one problem their fw is 2.5MB !
[12:11:38] <RikusW> I took like 2 months to RE the jtag fw and thats only 10kb.....
[12:12:23] <RikusW> Steffanx: guess I'll have to write some sync code and then buffer everything on 4 byte boundaries...
[12:13:08] <RikusW> that will be used only as a PC interface to the module anyways
[12:13:30] <RikusW> I'm connecting a GPS on the normal serial port that used to connect to the PC
[12:13:59] <RikusW> PCB's are sent to hackvana already :)
[12:14:14] <Steffanx> Not doing your own boards anymore ? :)
[12:14:19] <RikusW> *gerbers
[12:14:28] <RikusW> not 2 layers...
[12:14:41] <Steffanx> ( nothing beats the price of cheap chinese board anywau )
[12:14:44] <Steffanx> way
[12:14:44] <RikusW> especially not ones with 50 Ohm RF traces...
[12:15:14] <RikusW> and sounds like the quality is good too :)
[12:27:47] <RikusW> megal0maniac: I used the U2S in serial mode with it, at 115200bps, it works perfectly
[12:28:01] <RikusW> I only have one serial port on this PC....
[12:41:52] <kline> im looking at the datasheet for the m32, and the ADC has an autotrigger mode for Timer1 Compare Match B. when i check T1s CTC mode documentation, theres no reference to compare match b. is there a suggested way to get CTC-mode like behavior but on match b (versus match a?)
[12:52:41] <RikusW> OCR1A and OCR1B ?
[12:52:56] <RikusW> and using ICR1 as top maybe ?
[14:15:16] <creep> behold, the super SSR http://tinypic.com/view.php?pic=magplf&s=6 http://tinypic.com/view.php?pic=147dkn&s=6
[14:17:01] <creep> 400V 25A, input has current generator, reverse polarity protection, dipped in transparent epoxy, control is via CAT5-E twisted pair, power line is thick silicone cabling
[14:17:23] <creep> grabbed the heat sink from a dead motherboard's chipset :)
[14:18:46] <theBear> meh, nobbad
[14:34:54] <Roklobsta_> hey youse, anyone played with Atmel's radio chips for zigbee and such?
[16:30:03] <NullMoogleCable> anyone want to help me identify a atmel chip that has been sanded to ubfusticate it?
[16:30:35] <creep> how you know it is an avr ? ;/
[16:30:42] <NullMoogleCable> http://wtfmoogle.com/wp-content/uploads/2013/03/atmel3.jpg
[16:30:52] <NullMoogleCable> I can make out atmel mega
[16:31:02] <Malinuss> NullMoogleCable, easy
[16:31:28] <Malinuss> NullMoogleCable, connect the programmer, use AS, try to program the fuses and it tells you which on it is
[16:31:58] <NullMoogleCable> http://wtfmoogle.com/wp-content/uploads/2013/03/atmel5.jpg
[16:32:01] <Malinuss> NullMoogleCable, if you can't figure out the pinouts just look at different atmega pinouts and try them all
[16:32:09] <NullMoogleCable> there is a programming port
[16:32:20] <Malinuss> NullMoogleCable, well problem solved then
[16:32:53] <NullMoogleCable> http://wtfmoogle.com/wp-content/uploads/2013/03/atmel1.jpg
[16:33:13] <NullMoogleCable> http://wtfmoogle.com/wp-content/uploads/2013/03/atmel4.jpg
[16:35:42] <Steffanx> somehow i read mega8L there NullMoogleCable
[16:35:55] <Steffanx> on atmel1.jpg
[16:36:13] <NullMoogleCable> it could be mega 8U
[16:36:30] <Steffanx> 8L exists too
[16:38:21] <Steffanx> the mega8u has an extra 2, as it's called the mega8u2
[16:39:58] <Steffanx> I wonder how old that chip is NullMoogleCable
[16:40:17] <Steffanx> As it has the text "atmel" on it, and not the atmel logo like most AVRs
[16:40:48] <NullMoogleCable> it is part of a ir touch screen add on panel
[16:42:11] <creep> i'd use UV and IR photos too...
[16:42:32] <creep> that sanding work is half-done only
[16:44:15] <Steffanx> After sharpening it a little i would really go for a mega8L
[16:44:51] <Steffanx> The second last line probably says "korea"
[16:45:04] <Steffanx> Which looks like http://www.wvshare.com/img/photos/ATmega8L-8MU_l.jpg in a different package
[16:45:14] <NullMoogleCable> Korea -A
[16:45:17] <NullMoogleCable> i think
[16:45:21] <Steffanx> 726 is there too
[16:45:23] <creep> http://wtfmoogle.com/wp-content/uploads/2013/03/atmel1.jpg < from this i see atmega8l
[16:45:26] <Steffanx> oh not :P
[16:45:39] <creep> i have 2 of them too
[16:46:37] <Steffanx> oh lol, not a different package :P
[16:46:42] <Steffanx> Im sleepy
[16:49:48] <NullMoogleCable> 8??U08076?
[16:50:05] <OndraSter_> no
[16:50:07] <NullMoogleCable> KOREA -A
[16:50:10] <OndraSter_> oh
[16:50:25] <OndraSter_> I see atmega8L too
[16:50:36] <Steffanx> you see mega8L :P
[16:50:41] <OndraSter_> sure
[16:51:16] <NullMoogleCable> http://wtfmoogle.com/wp-content/uploads/2013/03/atmel2.jpg
[16:51:25] <NullMoogleCable> definately a L
[16:51:50] <OndraSter_> can't you just hook up it to ISP and read the device ID?
[16:52:17] <NullMoogleCable> trying to figure out the pinout to the port
[16:52:37] <OndraSter_> well try finding GND connections :P
[16:52:41] <OndraSter_> they are the easiest to find
[16:53:26] <OndraSter_> same for vcc
[16:53:29] <NullMoogleCable> ??U08076 is the third line
[16:53:40] <OndraSter_> the mega*u* can be find easily too - it has got 10uf cap on one pin only
[16:53:45] <OndraSter_> usbvcc or something
[16:54:16] <OndraSter_> so it is mega8
[16:54:21] <OndraSter_> just get the datasheet :P
[16:54:22] <Steffanx> is that line really important NullMoogleCable ?
[16:54:41] <Malinuss> OndraSter_, well I sugested that but "nono" lol
[16:54:45] <OndraSter_> oh
[16:54:59] <Malinuss> first thing that came to my min
[16:55:00] <Malinuss> d
[16:58:24] <OndraSter_> I have untangled today over 1km of wthernet wire :P
[16:58:29] <OndraSter_> my fingers are very, very broken :D
[17:01:45] <Steffanx> and why?
[17:05:20] <OndraSter_> why not?
[17:05:27] <OndraSter_> wthernet = ethernet*
[17:07:10] <creep> and microcontrollers return typecode on programmer cable...
[17:08:28] <creep> sanding the types only makes figuring out the connection harder
[17:20:54] <creep> how to change the page size in gschem? ;/
[17:21:04] <creep> lol
[17:29:27] <NullMoogleCable> http://wtfmoogle.com/wp-content/uploads/2013/03/atmel51.jpg
[17:29:44] <NullMoogleCable> next question. how do i connect to these small pads :/
[17:32:17] <OndraSter_> glue a wire to some piece of board
[17:32:20] <OndraSter_> glue the board to the PCB itself
[17:32:25] <OndraSter_> and then solder the pads directly
[17:32:26] <OndraSter_> on the pads
[17:32:38] <OndraSter_> (or glue the wires to the board from the up)
[17:32:42] <OndraSter_> but GLUE the pins first
[17:32:45] <OndraSter_> or you can rip off the pads
[17:32:50] <OndraSter_> err
[17:32:53] <OndraSter_> glue he wires
[17:32:53] <OndraSter_> the