#avr | Logs for 2013-02-13

Back
[01:03:24] <creep> h
[03:33:12] <schinken> what do you think is the "best practice" to transfer a bunch of data (48 bytes) over serial. I currently use a header 0xAA55 to determine if the package starts - but AA55 _could_ happen in the datapackage, too
[03:34:58] <Xark> schinken: Yeah, that is a "bad idea". Not sure if you remember +++ in modem days. :)
[03:35:40] <schinken> Xark: was "+" a pause?
[03:36:38] <Xark> schinken: Well, originally the Hayes modem standard said you could issue "+++" <couple second delay>"ATcommand" to escape a modem command.
[03:37:15] <Xark> schinken: Hayes patented the "delay", so clones skipped it and "bad people" could make people with clone modems hang up and do odd things with malicious files. :)
[03:38:30] <Xark> schinken: However, depending on your application having "SECRETCODEWORDHEREx0x0x0" may be "unlikely enough" in your expected data.
[03:39:05] <schinken> i wanted to keep the header small, so i can transfer my data faster
[03:39:37] <Xark> schinken: You could also "escpape" the code. I.e., send 0xDE0xDE for every "real" 0xDE and then if you see "0xDEADBEEF" is is likely to be packet header (but can add overhead to payload).
[03:40:01] <schinken> yes, escaping could be an option, too
[03:40:48] <schinken> but actually... whats the best practice here? a break in serial transmission?
[04:04:41] <Grievre> schinken: Do either of your devices support 9 data bits?
[04:04:53] <Grievre> schinken: if they're both avr's the answer is yes
[04:05:10] <schinken> they're not both AVRs
[04:05:17] <Grievre> schinken: what's the other one?
[04:05:19] <schinken> one of them is a serial2uart adapter
[04:05:32] <schinken> -serial +usb
[04:05:57] <Grievre> ah, a PC then. Um... well, you're a bit boned in that case, not because of a hardware issue but because of a driver issue
[04:06:15] <Grievre> most serial drivers for PC are designed to talk to modems or terminals or such... they're not so flexible
[04:06:22] <schinken> "bytesize – Number of data bits. Possible values: FIVEBITS, SIXBITS, SEVENBITS, EIGHTBITS"
[04:06:29] <schinken> also my library only supports that
[04:06:44] <Grievre> schinken: can you toggle the DTR etc bits?
[04:07:37] <schinken> maybe... i dont know the capabilities of the usb2uart "converter"
[04:07:49] <schinken> my pySerial library has a function for "setDTR"
[04:10:32] <OndraTabby> !seen OndraSter
[04:10:39] <OndraTabby> !seen OndraSter
[04:10:39] <tobbor> OndraSter was last seen in #avr on Feb 10 03:43 2013
[04:10:47] <OndraTabby> !time
[04:10:47] <tobbor> My watch says its 02:03AM Wed Feb 13 2013
[04:54:48] <Grievre> schinken: is most of the data going USB->PC or vice versa
[04:54:48] <Grievre> ?
[04:55:07] <Grievre> er AVR->PC
[05:14:22] <schinken> only PC->avr
[05:16:54] <Grievre> schinken: what kind of data are you sending?
[05:18:13] <schinken> just 48 values from 0 to 255
[05:19:41] <Grievre> schinken: you could set data bits to five, and transmit a nibble at a time, with the fifth bit only set at the beginning/end of the packet
[05:19:52] <Grievre> wastes a little bit of bandwidth
[05:20:25] <schinken> that sounds dirty :D
[05:21:28] <Grievre> schinken: what is your especific application?
[05:21:49] <schinken> its a small board with 3 i2c PWM chips (each 16 channels).
[05:22:00] <schinken> i just want to send the values for my 48 channels (0-255)
[05:22:18] <schinken> i could make 254 als bright as 255, and use 255 as start byte
[05:22:19] <schinken> that could be a possibility, too
[05:23:09] <Grievre> schinken: how frequently do you do this?
[05:23:17] <schinken> as fast as i can :)
[05:23:21] <Grievre> ah
[05:23:37] <schinken> my goal is a high update rate for smooth animations
[05:23:42] <Grievre> sounds kind of like my thing: http://www.youtube.com/watch?v=kiJQ8YF3ydc
[05:24:00] <Grievre> well I2C is going to be the limiting factor here
[05:24:07] <Grievre> as it has been with me
[05:24:09] <schinken> yes, it is
[05:24:13] <schinken> only 400khz atm
[05:24:25] <schinken> my i2c chips can go up to 1mhz... ill try that on friday
[05:24:36] <schinken> Grievre: impressive project, btw
[05:24:51] <Grievre> In my case the LED driver chips aren't PWM, they're being manually PWMed by the AVRs
[05:24:59] <Grievre> they're just shift registers with one bit per channel to turn it on or off
[05:25:14] <Grievre> but the individual AVRs are being fed with I2C... which was not by decision, and definitely a very bad choice
[05:25:40] <Grievre> schinken: Have you considered using a raspberry pi? it has I2C pins and you can run your python right on it
[05:25:44] <Grievre> schinken: they're only $35
[05:25:57] <Grievre> plus the cost of an SD card
[05:26:02] <schinken> http://www.hackerspace-bamberg.de/Dmx2rgb <- thats the board. its commonly used for dmx in our hackerspace. now im modifying the software for another project
[05:26:33] <schinken> Grievre: we have already a working board for that stuff, so why not use this ;)
[05:26:34] <Grievre> schinken: oh you're already using DMX? That's pretty much just serial you know
[05:26:56] <Grievre> 8 data bits no parity 1 stop bit, 250000 bps, with a break and then a mark before each packet
[05:26:58] <schinken> Grievre: for my new project im not using dmx.. :)
[05:27:12] <schinken> Grievre: dmx uses 2 stopbits
[05:28:39] <Grievre> schinken: oh right of course
[05:28:52] <Grievre> well if your receiver is an AVR it doesn't care about the second stop bit
[05:29:23] <schinken> Grievre: my modified software works, and fast... but i thought "is there a best practice for what i'm doing!?"
[05:30:00] <Grievre> schinken: *nod* unfortunately serial does not make it easy to do these things
[05:30:13] <Grievre> schinken: perhaps you could look up how PPP works? It sends packeted data over serial and has to handle corruption
[05:30:25] <schinken> Grievre: the dmx2rgb board lights up our "Lounge" (http://tour.hackerspace-bamberg.de) (the shelf on the right)
[05:30:43] <schinken> PPP?
[05:31:31] * Grievre suddenly feels really old
[05:31:38] <Grievre> schinken: did you never have dial-up internet?
[05:31:49] <Grievre> PPP is one of two protocols (the other is SLIP) used to do IP over a modem
[05:32:03] <schinken> oh of course i had
[05:32:17] <schinken> i didnt think of dial-up connections ;)
[05:32:47] <Grievre> schinken: a dial-up connection just looks like serial to the computer
[05:33:02] <Grievre> since that's how computers usually talked to modems (at least until winmodems came out)
[05:33:23] <schinken> jeah and its a weird serial readable ascii stream
[05:33:30] <schinken> for dialup, wait, etc pp
[05:34:46] <Grievre> OH! I just got a nasty, nasty idea
[05:35:49] <schinken> the avr could tell me when it wants a new datastream
[05:36:00] <Grievre> schinken: when you send the beginning-of-frame marker, set the serial line to 8 data bits, 1 parity, 1 stop bit, just for that bit
[05:36:00] <schinken> but i dont want to wait for "hey, start sending"-packets
[05:36:06] <Grievre> and send a byte that will result in a parity bit of zero
[05:36:13] <Grievre> then set it to 8 data, no parity, 2 stop bits for the actual data
[05:36:18] <Grievre> then on the AVR, set it for 9 data bits
[05:36:24] <Grievre> you'll get the "parity" bit as the 9th data bit
[05:36:41] <Grievre> and see it as zero for the start of frame marker but 1 for all of the other bits
[05:36:41] <schinken> uh jeah thats nasty
[05:36:43] <Grievre> this might not work
[05:37:19] <schinken> at first i thought "hey, just be compatible to dmx!" https://github.com/schinken/dmx2rgb/blob/master/sw/dmx2rgb.c#L25
[05:37:30] <schinken> it uses the FE (frame error) to detect a pause
[05:37:47] <schinken> but i couldnt simulate that behaviour on with my pyserial and usb2usart adapter
[05:38:39] <Grievre> schinken: I mean the best practice with RS232 is that RS232 receivers should be designed so that losing bytes should be impossible or extremely unlikely
[05:38:44] <Grievre> using flow control if necessary
[05:39:29] <Grievre> schinken: if you send a "break" (dunno if pyserial lets you do this) it should generate a frame error on the other end
[05:40:12] <Grievre> yeah it does for sure
[05:40:30] <schinken> i can send a break... but after an hour i said "f*** this, itll be a custom solution" - which worked 5 minutes later ;)
[05:41:14] <Grievre> schinken: unless there is noise on the line you should always be able to detect when a byte got dropped, the AVR sets error flags for that
[05:42:04] <schinken> yep
[07:12:53] <OndraSchool> sup
[07:13:01] <OndraSchool> my home server died yesterday.
[07:13:24] <OndraSchool> I am now at Embedded Systems school
[07:13:24] <OndraSchool> err
[07:13:24] <OndraSchool> class
[07:13:28] <OndraSchool> and I must say
[07:13:30] <OndraSchool> PICs are AWFUL
[07:13:59] <tk`> hello
[07:14:04] <tk`> a question
[07:14:22] <OndraSchool> an answer
[07:14:23] <tk`> can i generate interrupt both on compare match and at overflow in timer1?
[07:14:30] <OndraSchool> yes
[07:15:11] <tk`> cool, i quess it would be normal mode with OCF1A bit in TIMSK?
[07:16:00] <tk`> some manual i read says that interrupt on compare is only for ctc mode, that's why i'm asking
[07:16:07] <OndraSchool> huh
[07:16:11] <OndraSchool> no idea
[07:16:16] <OndraSchool> can't check datasheet atm
[07:16:50] <tk`> k, will need to do some experiments then
[07:19:14] <OndraSchool> aand I am off
[07:19:16] <OndraSchool> bbl
[07:19:24] <OndraSchool> once I fix my home server
[07:19:29] <OndraSchool> = probably reinstall
[07:19:59] <OndraSchool> I changed motherboard
[07:20:04] <OndraSchool> the old one died :(
[07:20:06] <OndraSchool> again!
[07:20:08] <OndraSchool> caps again :P
[07:20:11] <OndraSchool> the rest of them
[07:20:21] <OndraSchool> bbl!
[07:21:36] <Malinuss> tk`, did you figure it out? Which uC do you have?
[07:21:48] <tk`> not yeeat, atmega8
[07:21:56] <tk`> no yet, atmega8*
[07:23:03] <Malinuss> tk`, and what are you trying to do again?
[07:23:29] <tk`> i would like timer1 to generate interrupt on overflow
[07:23:33] <tk`> and on compare match
[07:23:56] <tk`> i don't want to clean it at compare
[07:24:10] <tk`> not sure if it's even possible
[07:24:52] <tk`> i recal i saw something like this, but can't find it
[07:24:53] <Malinuss> tk`, eh, but now PWM, just a jump to the vector?
[07:25:05] <tk`> yeah, no pwm
[07:25:06] <yunta> tk`: I'm almost completely sure it is, but read the specs for your chip.
[07:27:29] <Malinuss> okay let us take a look tk
[07:28:43] <yunta> WGM11:0 <= mode 0
[07:28:51] <tk`> going through datasheet now
[07:29:09] <tk`> yeah, wgm certainly 0
[07:29:54] <yunta> then just set OCIE1A/B
[07:30:06] <yunta> and TOIE1
[07:34:02] <tk`> ok, thank you
[07:49:56] <OndraTabby> 'sup
[07:50:16] * RikusW just soldered a SC70JW-8 AAT3681IJS-4.2-T1 IC deadbug style
[07:50:36] <RikusW> its 8 pin dip but 0.5mm pitch...
[07:50:42] <OndraTabby> DIP 0.5mm?!
[07:50:43] <OndraTabby> nice
[07:50:56] <RikusW> gewt the AAT3681 ds
[07:51:05] <RikusW> its a li-ion charge controller
[07:51:08] <OndraTabby> oh
[07:51:27] <RikusW> RS part nr 700-2274
[07:51:31] <RikusW> fairly cheap
[07:51:58] <RikusW> I had to test before designing its pcb....
[07:52:30] <RikusW> I strip normal wire and use the tinned strands to solder to the pins
[07:53:11] <RikusW> I only apply heat to the strand not the actual pins, because that would cause bridging....
[07:53:34] <RikusW> and I solder the pin last..
[07:54:08] <RikusW> OndraTabby: its almost J-leaded
[07:54:16] <OndraTabby> yeah, it looked like that
[07:54:31] <OndraTabby> but it looks flat
[07:54:33] <OndraTabby> from the bottom
[07:54:39] <RikusW> yes
[07:54:51] <OndraTabby> ARRGH
[07:54:52] <RikusW> have you seen my GTL2000 mounted deadbug style ?
[07:54:54] <OndraTabby> why in ONE class we do AVRs
[07:54:58] <OndraTabby> and in ANOTHER class we do PIC
[07:55:01] <OndraTabby> nope
[07:55:19] <Malinuss> OndraTabby, what are you studying btw.?
[07:55:23] * RikusW didn't know PIC had class :-P
[07:55:24] <OndraTabby> computer engineering
[07:55:28] <OndraTabby> heh
[07:55:35] <OndraTabby> it is Embedded Systems class
[07:55:45] <RikusW> http://imageshack.us/photo/my-images/221/gtl2000dl.jpg/
[07:56:09] <OndraTabby> oh nice
[07:56:21] <RikusW> had to test before doing the pcb
[07:56:28] <RikusW> took about a hour to mount it
[07:56:44] <RikusW> .635 pitch
[07:57:03] <creep> h
[07:57:04] <RikusW> 25 mil
[07:57:39] <creep> who knows a word to "hover and go in a direction"?
[07:57:46] <RikusW> finally got level translation working for PDI using that :)
[07:57:49] <creep> hover meaning to stay stationary
[07:58:07] <RikusW> glide ?
[07:58:24] <creep> i was thinking that too, but that has another defintiion ;/
[07:58:46] <creep> http://www.thefreedictionary.com/glide
[07:58:54] <creep> To move in a smooth, effortless manner: a submarine gliding through the water. See Synonyms at slide.
[07:59:01] <creep> To move silently and furtively.
[07:59:40] <creep> can i say "hover left" ?
[08:00:45] <RikusW> maybe
[08:01:10] <creep> so a simple one-plane movement without pitch or roll
[08:01:11] <RikusW> go read wikipedia on hovercraft ?
[08:22:06] <OndraTabby> yay hovercraft!
[08:40:42] <creep> well it only says "travelling over land" and "hover at heights between 200 mm and 600 mm above any surface"
[08:41:10] <creep> http://en.wikipedia.org/wiki/Air-cushion_vehicle
[08:43:56] <theBear> heh, hovercraft
[08:46:02] <theBear> i did all the theory and stuff on small scale ones about 20 years ago.. had to go to the state library for info back then :)
[08:46:57] <RikusW> Adid you build any ?
[08:54:27] <creep> hovercraft is cool, if you live in the mud area
[08:54:52] <creep> hovers over land/water/anything
[08:57:44] <jacekowski> vacuum?
[09:19:59] <Malinuss> Is there anything clever you can do, when using a server, and having a chip that doesn't have the Input Capture Register? Like when I use the servo on my "normal" (not tiny) uC I just can have a "custom" TOP to have it run at 50hz, and then just adjust the compare value to set the time it is on (which sets the angle of the servo).
[09:24:01] <RikusW> yes its called PWM
[09:24:14] <RikusW> check the AVR timer modes
[09:28:35] <Malinuss> RikusW, yes I'm aware of that, I'm not sure you are following me... I want to be abel to *set* on TOP, each 50hz, and have it *clear* on compare....
[09:29:01] <Malinuss> RikusW, without using the input capture register...
[09:29:38] <RikusW> are you using ICR for something else ?
[09:29:56] <RikusW> there is another register that you can use for top, check the modes
[09:31:05] <RikusW> like OCRA
[09:31:16] <Malinuss> RikusW, yes I don't have the ICR, because I'm using a tiny. Now, I can use OCRA for top, but how would I then decide how long it will be on for?
[09:31:28] <RikusW> which tiny ?
[09:31:34] <Malinuss> attiny13a
[09:34:48] <RikusW> use ORC0B ?
[09:37:32] <Malinuss> RikusW, aww yes ;D, thanks
[09:37:40] <Malinuss> It should work
[09:37:47] <Malinuss> then just use the second output port
[09:39:38] <RikusW> be aware the lower OCR0A the less resolution you have, especially since its an 8 bit timer...
[09:41:21] <Malinuss> RikusW, yeah I need to do it with the prescalar that will allow me the higest OCR0A value
[09:41:49] <RikusW> which would be /1024.. ?
[09:44:11] <Malinuss> RikusW, yeah, eveyrthing else and it would be 255+, which isn
[09:44:16] <Malinuss> *which won't work either
[09:44:58] <Malinuss> at least not when the clock is running 9,5MHz, but I rather not prescale the FCPU
[09:45:11] <RikusW> why not ?
[09:50:07] <Malinuss> RikusW, my math is saying that it won't change a thing, because it's all ^2 anyway
[09:51:32] <Malinuss> so the only value I can get 255> is 186,5... sigh...
[12:44:06] <megal0maniac> 'Lo
[12:44:51] <megal0maniac> wth? OndraSter isn't online?
[12:45:04] <megal0maniac> Is this #avr?
[12:45:25] <specing> His server died :D
[12:45:35] <specing> Thats what you get for running windows on it
[12:46:50] <megal0maniac> Heh :) Server goes down and IRC dies. Poor.
[12:47:12] <Steffanx> specing, like that matters. He is ALWAYS here
[12:47:15] <Steffanx> As in he talks
[12:48:11] <specing> Steffanx: would you prefer having a silent channel?
[12:48:25] <megal0maniac> specing: How long now?
[12:48:41] <Steffanx> No, but HE always talks
[12:48:46] <specing> Steffanx: you have to understand
[12:48:57] <megal0maniac> Steffanx: I'll be sure to voice my thoughts more often, then :P
[12:49:07] <specing> Steffanx: we (kids these days) have no AFK friends or a life outside of computers
[12:49:20] <megal0maniac> Except, I'll have to set up a vpn. University blocks everything :/
[12:49:36] <megal0maniac> specing: Even AFK, there's university and little else..
[12:49:40] <Steffanx> I know, so .. how can he not be here? specing ?
[12:49:58] <megal0maniac> Must be dead
[12:50:13] <megal0maniac> No other reasonable explanation
[12:51:21] <megal0maniac> 'Lo RikusW
[12:51:30] <RikusW> hi megal0maniac
[12:52:33] <RikusW> I finally solved the PDI level translator problem with this -> http://imageshack.us/content_round.php?page=done&l=img221/144/gtl2000dl.jpg
[12:52:52] <Malinuss> RikusW, thanks for the help before btw.. damn that I couldn't see that myself, haha
[12:53:04] <specing> megal0maniac: I know
[12:53:05] <megal0maniac> RikusW: Just run the U2S at 3v3 and overclock :D
[12:53:10] <RikusW> sometimes you're too close to the problem...
[12:53:11] <megal0maniac> But that does look fancy
[12:53:22] <RikusW> megal0maniac: its a GTL2000DL ic
[12:53:30] <specing> megal0maniac: maybe he is soldering the server's motherboard?
[12:53:33] <RikusW> 25mil / 635um pin spacing...
[12:53:41] <specing> Steffanx: ^
[12:53:45] <RikusW> took an hour or so to solder
[12:53:49] <Malinuss> RikusW, fiy: even with the "best" prescaling, the resolution is so bad, that the servo can only be set to like 15 positions ;D
[12:54:03] <RikusW> Malinuss: use a 16 bit timer.
[12:54:06] <megal0maniac> I remember Tom_itx mentioning that once. That's some tiny soldering there. Nice work
[12:54:15] <RikusW> or use a higher frequency
[12:54:29] <RikusW> thanks :)
[12:54:43] <RikusW> megal0maniac: I use tinned strands of multistranded wire
[12:54:50] <Malinuss> RikusW, yeah that's what I normally use on my atmega for the servos. I just wanted to try on the tiny :). it only has a 8-bit hehe
[12:55:05] <RikusW> using wire wrap wire is too time consuming, stripping the insulation...
[12:55:29] <RikusW> Malinuss: or do it in fw instead but use the timer too
[12:55:43] <RikusW> use the timer irq + fw that is
[12:56:07] <RikusW> megal0maniac: it took about an hour or so
[12:57:01] <RikusW> megal0maniac: I'm building a HVPP + translator board and a simple pinout converter board for JTAG ISP TPI PDI
[12:57:13] <RikusW> the converter will plug into the translator board
[12:57:22] <RikusW> or the HVPP board for HV TPI
[12:57:53] <RikusW> the PCBs are about finished, just need to double check everything...
[12:58:47] <RikusW> megal0maniac: I built a li-ion charger test circuit today too :)
[12:59:04] <RikusW> using AAT3681 RS nr: 700-2274
[12:59:23] <RikusW> only problem is its _small_
[12:59:33] <RikusW> 0.5 pitch
[12:59:44] <megal0maniac> You have been busy :/
[12:59:48] <RikusW> yep
[13:00:06] <RikusW> 8 pin dip 2x2mm
[13:00:24] <RikusW> x1mm high...
[13:00:55] <RikusW> thinking of connecting it to a 6V 50mA solar panel
[13:01:05] <RikusW> that is about R32 / 3E
[13:01:56] <Malinuss> RikusW, what is "fw"? what does it stand for?
[13:02:01] <RikusW> firmware
[13:02:08] <RikusW> hw fw sw
[13:02:11] <Malinuss> hehe yeah ;P
[13:02:27] <Malinuss> I'm guessing you meant sw then ;P?
[13:02:37] <RikusW> fw is the code in an AVR
[13:02:57] <Malinuss> it is? is all code on a uC firmware?
[13:03:00] <megal0maniac> RikusW: Any updates to the U2S firmware?
[13:03:03] <RikusW> afaik
[13:03:09] <Malinuss> I see
[13:03:10] <RikusW> megal0maniac: none
[13:04:00] <RikusW> megal0maniac: putting the 10k pullups on the GTL breaks PDI...
[13:04:18] <RikusW> I use a 470R between Rx/Tx
[13:04:31] <RikusW> Tom_itx used 300R
[13:04:37] <megal0maniac> RikusW: You're overcomplicating things. Just overclock :P
[13:04:50] <RikusW> that works too..
[13:04:58] <megal0maniac> Maybe resistors or zeners for IO protection
[13:05:01] <RikusW> but sometimes you need level translation too
[13:05:21] <megal0maniac> Yeah, I suppose.
[13:05:33] <megal0maniac> The transistor based thing doesn't work so lekker
[13:05:58] <RikusW> I noticed something weird connecting a 2n7002 gate to Vcc and S/D to reset disables my dW disabling :(
[13:06:17] <RikusW> it shouldn't... unless gate capacitance screws it up
[13:06:32] <RikusW> and 2n7002 don't work for dW either...
[13:06:53] <megal0maniac> That's weird. Although it is kind of a hack in the first place :P
[13:06:56] <RikusW> strangely enough my C9014 NPN bipolar translator works fine for dW
[13:07:06] <RikusW> I used 3k3 on the base to LW
[13:07:09] <RikusW> *LV
[13:07:17] <RikusW> and 12k for pullups
[13:07:23] <megal0maniac> RikusW: Did I tell you I've started studying elec eng?
[13:07:27] <RikusW> and E to LV and C to HV
[13:07:31] <RikusW> yep
[13:07:45] <RikusW> but the C9014 only work down to 3v3
[13:10:45] <megal0maniac> brb, food
[14:44:48] <creep> h
[14:45:03] <OndraPC> w
[14:45:18] <creep> who feels like making a capacitive usb joystick?
[14:47:44] <creep> i haven't seen any opensource one yet but it's simple
[15:03:02] <Elco> Hi Guys, I am using Atmel Studio 6 and I am using the toolchain settings dialog. But now I would like to support Linux/Mac users as well and want to switch to using makefiles
[15:03:23] <Elco> is there anyone that can help me out doing this? I am kinda stuck
[15:03:31] <Elco> it is for my open source project BrewPi
[15:03:35] <OndraPC> support linux/mac users?
[15:04:07] <Elco> well, Atmel Studio is not available on those platforms
[15:04:08] <Malinuss> Elco, if the source is open, isn't that "support" enough :). but yeah in atmel studio 6, you can use makefiles too
[15:04:25] <Elco> so to use avr-gcc on these platforms I need to use makefiles
[15:05:30] <Elco> and ideally, I want to have 4 build profiles: Atmega328, Atmega32u4, both with SYMBOL TEMP_FORMAT set to ´C´ or ´F´
[15:05:57] <Tom_itx> there are some example code here with makefiles: http://tom-itx.dyndns.org:81/~webpage/avr/
[15:07:09] <Malinuss> Tom_itx, can't quiet remember if I already said it, but your programmer is working as expected.. Everything works, I love it ;P
[15:07:14] <Elco> the makefile Atmel Studio outputs is missing a lot of the toolchain settings. Are these added by command line parameters?
[15:07:53] <Malinuss> Tom_itx, I dropped it on the floor today, lucikly it didn't break heh
[15:08:52] <OndraPC> it is 1.6 FR4! IT WON'T BREAK!
[15:08:55] <OndraPC> lol
[15:09:16] <Tom_itx> which one did you get? i forget
[15:09:26] <Malinuss> Tom_itx, the one without the case :)
[15:09:30] <Tom_itx> ahh
[15:09:34] <creep> 1mm fiberglass won't break either... it is the solder joints
[15:09:42] <creep> and components that will break first
[15:09:42] <Tom_itx> it's not drop tested btw
[15:09:51] <Malinuss> Tom_itx, it is now xD
[15:10:28] <creep> ics are brittle, especially the thin tqfps
[15:10:32] <Tom_itx> you using avrdude or studio?
[15:10:58] <Malinuss> Tom_itx, studio the newest, works like a dream, like a MKII, setting fuses and everything
[15:11:01] <Tom_itx> creep, it would likely hit the connectors and not the chips
[15:11:08] <abcminiuser> Programmer's Notepad - Printer.hex
[15:11:09] <abcminiuser> 1 :1000000086C00000A1C000009FC000009DC000008D
[15:11:09] <abcminiuser> 2 :100010009BC0000099C0000097C0000095C0000080
[15:11:09] <abcminiuser> 3 :1000200093C0000091C00000D7C20000A2C300002E
[15:11:09] <abcminiuser> 4 :100030008BC0000089C0000087C0000085C00000A0
[15:11:09] <abcminiuser> 5 :1000400083C0000081C000007FC000007DC00000B0
[15:11:11] <abcminiuser> 6 :100050007BC0000079C0000077C0000075C00000C0
[15:11:13] <abcminiuser> 7 :1000600073C0000071C000006FC000006DC00000D0
[15:11:15] <abcminiuser> 8 :100070006BC0000069C0000067C0000065C00000E0
[15:11:19] <abcminiuser> 9 :1000800063C0000061C000005FC000005DC00000F0
[15:11:20] <Tom_itx> dude
[15:11:21] <abcminiuser> Hah
[15:11:23] <OndraPC> DUDE
[15:11:23] <abcminiuser> Totally works
[15:11:26] <OndraPC> heh
[15:11:28] <OndraPC> what is that
[15:11:29] <OndraPC> ?
[15:11:35] <OndraPC> are you programming in hex now?
[15:11:39] <Malinuss> some secret AVR bootlader
[15:11:43] <abcminiuser> That is part of a HEX file, being received by my USB printer bootloader
[15:11:46] <abcminiuser> :D
[15:11:56] <OndraPC> eh?
[15:11:58] <abcminiuser> You literally print a HEX file to it
[15:12:02] <OndraPC> LOL
[15:12:07] <OndraPC> would be better with a scanner though
[15:12:13] <OndraPC> and scan your bootloader :)
[15:12:44] <abcminiuser> Just need to make the HEX parser now, that should be easy
[15:12:50] <abcminiuser> And I'll have a cross platform, zero driver bootloader over USB
[15:12:58] <Malinuss> Elco, what I think you could do, would be to use external makefiles for atmel, and then just share the source +makefile, and you know it works...
[15:12:59] <OndraPC> hehe nice indeed
[15:13:40] <Elco> yes, that is what I want to do
[15:14:16] <Elco> but the makefile should define some symbols, the arduino include dir, etc
[15:14:27] <Elco> which I had all set up in atmel studio
[15:14:45] <Elco> but I does not seem to copy these to a makefile automatically, which I hoped
[15:15:25] <Elco> This is what I normally did: http://www.elcojacobs.com/easy-to-use-atmel-studio-project-for-arduino-and-programming-the-arduino-from-python/
[15:15:57] <Malinuss> oh snap
[15:16:22] <Malinuss> yeah that might be a pain without AS.. I don't know
[15:16:33] <Tom_itx> ahh yeah Malinuss, yours was the one that got there amazingly fast
[15:17:01] <Malinuss> Tom_itx, yup. only a couple of days from middle of USA to denmark
[15:17:26] <tandoori> hey Malinuss
[15:17:27] <tandoori> you too Tom_itx
[15:17:38] <tandoori> i need a bit of help with my coding, mind taking a peek?
[15:17:53] <Malinuss> sure
[15:18:14] <tandoori> dont worry its very simple, you wont be reading ages and ages of code
[15:18:21] <tandoori> just a moment let me pastebin it
[15:21:08] <tandoori> Malinuss: http://pastebin.com/NkeBmLZv
[15:21:50] <Tom_itx> tandoori, abcminiuser isn't good enough :)
[15:22:08] <abcminiuser> ?
[15:22:13] <tandoori> beg pardon?
[15:22:14] <tandoori> lol
[15:22:17] <Malinuss> haha
[15:22:20] <Malinuss> my sides
[15:22:46] <Malinuss> but what is the problem tandoori ?
[15:22:56] <tandoori> okay the timing for the
[15:23:08] <Tom_itx> that's friggin ardweenie
[15:23:23] <tandoori> button portion of the code seems to be correct
[15:23:28] <tandoori> ive tested the signals via my oscope
[15:23:34] <tandoori> but look at the led code down there
[15:24:15] <tandoori> its supposed to basically transmit the byte that was read by the button to the other shift register to turn on the appropriate ligths
[15:24:26] <tandoori> no leds light up :-(
[15:24:51] <tandoori> now note the following line:
[15:25:10] <tandoori> if (((button >> x) & 0x01)){
[15:25:42] <tandoori> that is SUPPOSED to read each bit from the byte in question and return either a 0 or a 1
[15:26:30] <Malinuss> tandoori, eh, it would be easier for my, if I could see a schematic over your setup
[15:26:35] <Malinuss> *me
[15:27:01] <tandoori> hmm that may be difficult as i have not made an official schematic in diptrace
[15:27:12] <tandoori> i do have a picture of the project though
[15:27:44] <tandoori> moment
[15:27:46] <Malinuss> a schematic would be better
[15:27:46] <tandoori> http://imageshack.us/a/img820/9596/img20130207164749.png
[15:29:05] <Malinuss> yeah a schematic would definetly be better. but try explaning what you want to do....
[15:29:16] <tandoori> my main question is this: is that the proper way to read each bit from a byte?
[15:29:58] <tandoori> hmm i wonder if atmel studio supports a debug window...
[15:30:10] <Tom_itx> it does
[15:31:07] <Malinuss> you would read a bit from a byte like (byte &(1<<bit_to_read))
[15:32:41] <Elco> does anyone here use eclipse for AVR development?
[15:32:57] <tandoori> huh? then what does (byte >> x) & bit_to_read)) do?
[15:34:32] <tandoori> maybe that is the whole problem, right there
[15:35:34] <tandoori> oh, lol my example was messed up ^^
[15:37:21] <Malinuss> tandoori, normally you would debug that setup, by first testing, if your "output" works... so first just turn on all led's one after the other to make sure it works. Then you would check if the input works
[15:38:14] <tandoori> i am not familiar with turning on the debug output in atmel studio
[15:38:55] <tandoori> I am used to a specific command will display the data I want, like....oh, "debug x"
[15:39:12] <Malinuss> I'm not talking about a software debug... just test if your output works...
[15:39:35] <tandoori> you mean on chip?
[15:39:36] <tandoori> heh
[15:39:50] <tandoori> id rather software debug first then burn
[15:40:50] <wondiws> I got some code in AVR assembler, but it uses relative jumps, and my assembler doesn't allow that :S
[15:40:56] <wondiws> what is this?
[15:41:13] <wondiws> I'm using both AVRA and AtmelStudio 6...
[15:42:00] <Malinuss> okay, whatever... burning only takes like a couple of seconds, at you could easliy tell if something is wrong
[15:44:12] <wondiws> like "rjmp .-108", this gives me an error, but this code is is produced by a disassebler, so it can't be that bad... ?
[15:46:44] <creep> http://fox-actors.blogspot.hu/2011/10/infrared-photography.html
[15:55:08] <tandoori> Malinuss: i dont think that line you gave me evaluates to either a 0 or a 1
[15:55:51] <Malinuss> tandoori, it evauletes to 0 or 0<
[15:56:16] <tandoori> ugh
[15:56:18] <tandoori> i cant use tha
[15:56:22] <tandoori> (that)
[15:56:51] <Malinuss> yes you can... just - if(byte &(1<<bit_to_read)){bit is 1}else{bit is 0}
[15:57:41] <tandoori> but isnt the value signed?
[15:57:58] <tandoori> i tried to put that in a uint8_t and it tells me that the variable content is too large
[15:58:35] <Tom_itx> if it's signed it wouldn't be uint8_t
[15:58:49] <Malinuss> that is just used to evaluate whatever a bit in a byte is 0 or 1....
[15:59:01] <Malinuss> why would you "put it into a variable"
[15:59:24] <Malinuss> if you want to go trough a whole byte, just make a loop
[15:59:24] <tandoori> because i am trying to debug my application to check to see if that is evaluating properly
[16:00:57] <rogerr> I don't quite understand setting/clearing bits in avr registers? I get bit masks and the method of doing it itself but often bits seems to be referred to by their names in the data sheet e.g. PA7 or WGM01 - how does this work?
[16:01:15] <OndraPC> yes
[16:01:22] <OndraPC> SOMEREG |= (1 << WGM01)
[16:01:24] <OndraPC> for example
[16:01:56] <OndraPC> (to set the bit)
[16:02:02] <OndraPC> or SOMEREG &= ~(1 << WGM01);
[16:02:03] <OndraPC> to clear it
[16:02:28] <Malinuss> rogerr, look in the yourCHIPname.h ... you will see that each bit is just name 0-7, so you don't have to actually check it's position, but just it's name in the datasheet
[16:02:58] <rogerr> ah
[16:03:19] <Malinuss> so there is a #define WGM01 1 somewhere (not sure WGM01 is bit 1, but I think so)
[16:03:33] <OndraPC> tbh I wish they had gone with bit structures in the header files, would be much better :P
[16:03:44] <rogerr> I was looking in io.h and portpins.h - couldn't make any sense of it
[16:03:46] <OndraPC> like SOMEREG.WGM = TIMER_WGM_PWM
[16:04:00] <OndraPC> rogerr: you want io<yourchip>.h
[16:04:06] <rogerr> got it
[16:05:17] <Malinuss> OndraPC, not quiet following you, so what, they should have other names then in the datasheet? That would just be confusing
[16:05:44] <Malinuss> ah I get it now
[16:06:04] <Malinuss> haha like structures - the data type ;D
[16:08:09] <Malinuss> OndraPC, that would be good, because you wouldn't be abel to make the mistake, of thinking that a bit is in a wrong byte... We should write to atmel and so they could make abcminiuser rewrite all the includes, for all the chips...
[16:39:55] <OndraPC> Malinuss: you know they are auto generated? ;)
[16:40:14] <Malinuss> OndraPC, haha, I do now ;P
[16:40:44] <OndraPC> BUTT FU.K IT! I am going to fix the board, boot up the system, make the backup of all the services and migrate it to new windows install
[16:40:54] <OndraPC> it just won't boot on new board
[16:41:08] <OndraPC> hopefuly the bad caps didn't kill the MOSFETs
[16:52:52] <wakko> hi there
[16:53:16] <Malinuss> hello
[16:53:20] <wakko> do you know any code sample on how to use interupt on ATmega without the ASF ?
[16:54:51] <specing> wakko: see avr libc's docs? :O
[16:55:07] <wakko> i read asf code
[16:56:42] <Malinuss> wakko, what? asf?
[16:57:01] <wakko> yes
[16:57:12] <Malinuss> wakko, what does the atmel software framework have to do with interupts on a ATmega ;D
[16:57:38] <wakko> it does not define the ISR macro and the stuff that makes the interrupts usable ?
[16:57:44] <Malinuss> true
[16:57:47] <wakko> like mio.h and stuff
[16:57:51] <Malinuss> you could do it in asm
[16:58:09] <Malinuss> at least the interrupt
[16:58:31] <wakko> it cannot be done in C/C++ without the asf ?
[16:58:43] <specing> you just need a function of the form "void vector_XX ()"
[16:58:48] <specing> they are weak-linked
[16:59:17] <specing> those ISR macros only calculate the XX part for you
[16:59:26] <wakko> i got that
[16:59:43] <wakko> i found those symbols with readelf, but at the end the interrupts are never triggered
[16:59:57] <specing> you need to enable them
[17:00:03] <wakko> i did sei yes
[17:00:15] <specing> you need to enable specific ones too
[17:00:25] <wakko> like the uart ones ?
[17:00:30] <specing> yes
[17:00:44] <wakko> then i'll look on that area
[17:00:50] <specing> every interrupt source has its own interrupt enable
[17:00:58] <wakko> at first i was thinking about pmic, but atmega does not have
[17:01:08] <wakko> specing: good to know :)
[17:01:30] <specing> just look at the register map in the datasheet
[17:01:40] <wakko> yeepa !
[17:01:43] <wakko> thanks
[17:03:53] <Tom_itx> just RTFM already!
[17:06:19] <Malinuss> Tom_itx, no no... RTFD! hehe
[17:06:53] <wakko> i RTFM'ed intel, i'll RTFD atmel
[17:06:54] <wakko> :)
[17:07:20] <OndraPC> if you want PMIC, check out atxmega :P
[17:07:34] <wakko> i dont want pmic, but thanks OndraPC
[17:07:52] <specing> OndraPC: is back!
[17:07:53] <OndraPC> three levels of interrupt prioritie!
[17:07:59] <OndraPC> just from a webchat specing
[17:08:03] <OndraPC> before I somehow fix the server
[17:08:07] <wakko> i was just missing the "you have to enable each interrupt specifically"
[17:08:10] <specing> What blew?
[17:08:11] <OndraPC> the motherboard died again, caps blew up.. again
[17:08:15] <specing> lol
[17:08:23] <specing> What mobo?
[17:08:23] <OndraPC> the remaining ones lol
[17:08:27] <specing> haha
[17:08:29] <OndraPC> some cheap ass G31
[17:08:45] <specing> pop pop pop watching mothafuckas drop?
[17:08:57] <OndraPC> I have got new board + CPU + RAM, but the old windows installation is unable to boot with new harddrive controller
[17:09:13] <OndraPC> so I need to solder in some replacement caps at least for a few hours before I can back up all the AD
[17:09:19] <OndraPC> pretty much the only service I need to migrate
[17:09:32] <specing> lol
[17:09:43] <OndraPC> because of all the certificates 'n such
[17:09:47] <specing> aw
[17:09:54] <specing> no backups?
[17:09:58] <OndraPC> hell no lol
[17:10:24] <specing> theres your problem
[17:10:31] <OndraPC> if I were to simply create a new domain with the same name, my PC (or any in the home actually :P) would not allow me to log in, since the domain controller's certificate would not match anymore
[17:10:33] <OndraPC> yep
[17:10:42] <OndraPC> I was expecting to replace the board like ... a month ago
[17:10:47] <OndraPC> but the RMA of my PC's motherboard took longer
[17:10:53] <OndraPC> and I got replacement yesterday
[17:11:10] <OndraPC> but as I was installing the motherboard in my PC and taking out the temporary one (which will be now in the server) the server died :D
[17:11:15] <OndraPC> if it lasted 3 more days... :(
[17:11:48] <OndraPC> oh well
[17:12:03] <OndraPC> I will see if I have got some 220 - 1000uF caps in my back pack
[17:12:06] <OndraPC> and change them tomorrow
[17:12:14] <OndraPC> and hope that it hasn't killed any MOSFETs
[17:14:35] <OndraPC> anyway, off I go, gotta get up tomorrow so I can check the caps in stock before I leave for school
[17:14:36] <OndraPC> gn
[17:15:51] <Malinuss> night ondra
[17:31:06] * Tom_itx buys up all the available caps
[17:32:33] <Steffanx> Oh, mr ondra is dead again
[18:13:21] <parabyte> any good sites where i can look at other peoples avr C code
[18:13:28] <parabyte> im interested in 8bit C code
[18:13:30] <parabyte> many thanks
[18:15:17] <specing> avrfreaks?
[18:19:11] <Tom_itx> we don't write good code here
[18:19:15] <Tom_itx> we're just hackers
[18:21:43] <Tom_itx> parabyte, http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_howto_main_index.php
[18:22:01] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/avr/
[18:22:06] <Tom_itx> odds n ends there
[18:28:05] <Horologium> avrfreaks has lots of code.
[18:28:09] <Horologium> and google has more..
[18:28:11] <Horologium> just look around.
[18:50:16] <parabyte> Tom_itx, thanks
[18:52:16] <Tom_itx> what are you working on?