#avr | Logs for 2014-03-05

Back
[03:29:45] <OndraSter_> a bit of tech: http://huvrtech.com
[03:29:48] <OndraSter_> the future is here :D
[03:50:19] <hackvana> http://www.hitfix.com/comedy/huvr-cruelly-teases-us-with-fake-commercial-for-working-hoverboard
[03:56:10] <specing> the cake is a lie
[03:56:55] <OndraSter_> damn
[03:58:28] <specing> Aperture Science Hoverboard
[03:59:45] <OndraSter_> hehe
[03:59:51] <OndraSter_> I would be fine even with just long fall boots...
[04:00:36] <hackvana> I'll settle for cake
[06:17:11] <RikusW> hi megal0maniac_afk:
[06:35:19] <lolwat> oh hey
[06:36:51] <lolwat> my C code generates these insructions: http://pastebin.com/XXufuzbH
[06:37:22] <lolwat> ist great how gcc optimizes single bit changes to cbi sbi instructions
[06:38:10] <lolwat> my code doesn’t rely on a the special order those bits are set... that means I could group them to more efficient ldi + out intructions
[06:38:28] <lolwat> is there a way to tell gcc to do this optimization for me?
[06:41:07] <Lambda-Aurigae> when specific commands are needed I usually use inline asm.
[06:43:35] <lolwat> Lambda-Aurigae, I’m afraid I cannot go with inline asm here as the C code is generated by marcos
[06:44:21] <RikusW> port = const; should do the trick
[06:44:46] <Lambda-Aurigae> you could always do the compile, edit the assembly output, then run through the final assembler and linker stages.
[06:51:29] <lolwat> Lambda-Aurigae, RikusW, tk for your feedback ... I tried to outline my problem better: http://pastebin.com/ZA8zsDTT
[06:51:37] <lolwat> ty*
[06:53:22] <lolwat> I think gcc cannot do the optimizition because PORTB is defined as volatile and it thus preserves the order of execution
[06:55:00] <lolwat> I thought maybe there is a compiler flag or something to prevent that
[06:55:21] <lolwat> but it looks like this is really a problem of my code :-)
[06:57:07] <lolwat> OH ... I got the solution
[06:57:41] <lolwat> I just have to cast the PORT adresses to a non volatile pointer and dereference it again
[07:11:58] <ColdKeyboard> What can be a probable cause why MCU sends every 4th char wrong. For example if I want to sen 0x44 in while loop (with 1s delay in between), it sends 0x44, 0x44, 0x44 and 0x43 ?
[07:12:15] <ColdKeyboard> I have tried 2MHz, 4MHz and 8MHz crystal and still the same thing
[07:14:00] <RikusW> via uart ?
[07:16:23] <ColdKeyboard> Yes
[07:16:58] <RikusW> sounds weird, 44 44 44 42 I could understand but 43 ?...
[07:17:08] <ColdKeyboard> I said 43
[07:17:10] <ColdKeyboard> :)
[07:17:12] <RikusW> is the baud right ?
[07:17:24] <ColdKeyboard> Yes, I use formula to calculate it
[07:17:41] <ColdKeyboard> I'm not sure but maybe my setup is making an error, but how can it be so constant...
[07:17:53] <RikusW> the delay seems to rule out writing into the uart while its busy transmitting
[07:17:56] <ColdKeyboard> I have MCU UART->MAX232->Prolific->USB
[07:18:04] <RikusW> but do you check it anyways ?
[07:18:38] <ColdKeyboard> I have a function that waits until the transmitter is ready, and I also tried directly writing to the transmit register but same result
[07:19:29] <RikusW> try another AVR ?
[07:19:38] <RikusW> maybe the chip is broken
[07:19:59] <RikusW> It sounds like a confusing problem to me...
[07:20:32] <Thrashbarg> ColdKeyboard: if you're running off a 2/4/8MHz crystal there might be a baud rate error
[07:21:41] <Thrashbarg> ColdKeyboard: what speed are you setting the UART to?
[11:38:55] <bezoka> hello
[11:39:03] <synic> oh hi
[11:39:13] <bezoka> is hard to learn c for programming atmega8?:D
[11:39:36] <synic> bezoka: have you done any programming before?
[11:39:45] <bezoka> yea, c++
[11:40:35] <synic> the C part isn't hard, imho. It's knowing what stuff to put in which registers for what functions, but the datasheets tell you all that and are very comprehensive
[11:40:47] <bezoka> I burned two atmega8 ;)
[11:41:27] <synic> what did you do
[11:42:11] <bezoka> something like that: http://kursc.forbot.pl/img/art001_stykowa1.jpg but
[11:42:42] <bezoka> I put cable to gnd and after to vcc ;)
[11:43:29] <bezoka> I am newbie and didnt know where I needed give the wire ;)
[11:50:50] <bezooka> my network didnt work for a while
[11:51:42] <synic> that happens
[11:52:02] <synic> what programmer are you using there, just out of curiosity
[11:53:37] <bezooka> usbasp ;)
[11:55:16] <synic> you have it working now?
[11:55:45] <bezooka> programmer yes, but my atmegas not
[11:55:57] <bezooka> programmer dont find atmegas
[11:56:10] <synic> what do you mean? It can't find a valid signature?
[11:57:11] <bezooka> http://pastebin.com/qbnrfRu2
[11:57:14] <bezooka> I have that error
[11:58:01] <bezooka> it isnt fuse bits, because I checked it after programmed my atmega and it worked
[11:58:49] <bezooka> synic: brb
[11:59:05] <synic> what avrdude options are you using?
[12:05:40] <bezooka> synic: I used "mkavr calculator" and only put program into atmega ;)
[12:05:52] <bezooka> nothing more did
[12:06:37] <RikusW> maybe your fuses was set wrong, bricking the chips
[12:07:03] <bezooka> when I connect power, only one LED shine I connect LED to gnd or vcc ;)
[12:07:25] <bezooka> RikusW: no, really I checked it before I connect it to power ;)
[12:08:14] <bezooka> I programmed atmega, disconnect from netbook, after again connect and it worked ;)
[12:08:32] <bezooka> (sorry for my english, I still learning)
[12:24:16] <bezooka> I am noob, didnt see that: http://kursc.forbot.pl/img/art001_schemat1.png
[12:24:34] <bezooka> and I put cable from LED1 into vcc :D
[12:27:08] <bezooka> synic, RikusW: so I destroyed atmega for forever?
[12:27:47] <RikusW> maybe not
[12:28:16] <RikusW> fuses can be repaired
[12:29:34] <bezooka> RikusW: :D but I checked before I connect it into power, and it work. After that I connect it into power it didnt work ;)
[12:30:13] <bezooka> and then werent any problem with programming it ;)
[12:30:54] <bezooka> I didnt change fuse bits ;)
[12:34:30] <bezooka> RikusW: I promise you ;). unless power can change fuses ;) then sorry ;)
[12:34:58] <RikusW> did you reverse polarity ?
[12:35:04] <RikusW> or apply more than 5V ?
[12:35:42] <bezooka> apply only 5V and reverse polarity
[12:36:24] <bezooka> http://kursc.forbot.pl/img/art001_schemat1.png where is LED1 I put into VCC not GND
[12:49:04] <bezooka> hmm, one from atmegas can be work
[12:59:37] <bezooka> RikusW: If LED1 and LED2 work then atmega too work?
[13:00:01] <RikusW> no idea
[13:00:16] <bezooka> :D
[13:00:36] <RikusW> well, after looking at the image, probably
[13:01:22] <bezooka> so I have problem with programmer or windows:D
[13:01:25] <bezooka> or dont know
[13:06:35] <bezooka> RikusW, Synic: thanks for all:) I have to go, bye bye ;)
[14:04:40] <hotch> What's a good program that will work on OS X/Mac to design circuits/schematics like the one that bezooka posted?
[14:05:08] <hjohnson> hotch: I finally gave up and plunked down for the hobiest version of Eagle on my mac
[14:06:28] <hotch> It looks great, thanks hjohnson. Do you ever use it to design PCBs/have them fabricated? Now that I've learned so much I'd love to build something more "official"/off breadbboard.
[14:11:35] <hjohnson> yeah
[14:12:07] <hjohnson> hotch: just follow the proepr designflow... build your schematic first (and whatever fancy omponents you need) then lay out the pCB afterwards... this will make sure that hte board layout matches the schematics
[14:12:11] <hjohnson> etc.
[14:12:45] <hotch> kk
[15:42:13] <Jordan_U> Is it possible to use PORTA on a ATxmega128A1 for digital IO?
[17:30:22] <Lambda-Aurigae> Jordan_U, don't see why not...it is a gpio port with additional features tacked on..
[19:34:38] <hotch> Afternoon everyone. I need to do USB/Serial with UART on my AVR. Are there any cheaper options than these? (cheapest is at $14.95) http://www.digikey.com/product-search/en/cable-assemblies/smart-cables/1574108?k=FTDI or https://www.sparkfun.com/products/9873
[19:51:34] <Lambda-Aurigae> try ebay
[19:51:38] <Lambda-Aurigae> I've seen them for 2 dollars there.
[20:19:44] <hotch> good call, thx.