#avr | Logs for 2013-03-31

Back
[00:01:05] <langoliers> of course it does not matter for the microcontroller, gating it only prevents parallel port from seeing miso if U2 is tristated
[00:35:52] <langoliers> are those 100pf capacitors really needed for programming pins? ;/
[00:37:16] <Casper> no
[00:37:50] <Casper> the one on the reset you mean? it's there to help against spontanious reset due to noise on the line
[00:37:58] <Casper> the reset line is quite sensitive to noise
[00:38:39] <langoliers> well on 2 programmers i see 100pf caps on all pins to gnd
[00:39:16] <langoliers> ok maybe for reset... but this will slow down all pins
[00:40:05] <langoliers> and in case capacitor mismatch, it can skew signals at higher frequency
[00:41:02] <langoliers> isn't the capacitance of the properly grounded/shielded cable enough?
[00:46:20] <Casper> the reset pin is extremelly sensitive
[00:46:38] <Casper> I think it's specified to be active at like 0.5V bellow VCC
[00:46:50] <Casper> so a tiny bit of noise and bang, it reset
[00:47:03] <Casper> and long wires cause issues
[00:47:15] <Casper> long = more than about 6"
[00:47:46] <langoliers> oh i see
[00:48:11] <langoliers> then 100-220p only for reset
[00:49:37] <langoliers> but and every single microcontroller board has a resistor to vcc from reset, that should reduce the sensitivity
[00:49:59] <langoliers> like a 2.2k
[00:51:27] <langoliers> 0.5V*2.2k=0.22mA
[01:02:26] * Casper goes to bed
[01:02:26] <Casper> nite
[01:13:10] <megal0maniac> G'morning :D
[04:22:41] <langoliers> http://eda360insider.wordpress.com/2012/03/07/3d-thursday-altera-adds-avago-micropod-optical-interconnects-to-fpga-package-to-handle-bidirectional-100gbps-ethernet/
[04:33:03] <_abc_> Does anyone know if all inputs to the avr are Schmitt Triggers in hvpp programming mode? I can't find any rise time requirements in the datasheet so I conclude that they are, but does anyone know?
[04:33:35] <_abc_> (only reason not to have rise time specs on digital signals is, that they are Schmitt inputs and take care of the rise time themselves)
[04:34:27] <_abc_> In AtMega168 datasheet, pp. 72 diagarm shows a Schmitt input and there seems to be no other kind of input used. But IS this also true for programming mode? I hope it is, please say yes/no or point me at some more literature.
[04:40:41] <OndraSter_> why would you need hvpp mode? Just be careful :P
[04:41:01] <_abc_> Because I set RSTDISBL heh
[04:41:21] <_abc_> Datasheet does not mention RSTDISBL and DWEN kill SPI programming
[04:41:29] <_abc_> So please answer the question :)
[04:41:43] <OndraSter_> wow langoliers
[04:42:16] <langoliers> _abc_ you can use a cd4093
[04:42:26] <langoliers> or 40106 even
[04:43:07] <_abc_> I would like to not use anything but wires and switches
[04:43:12] <langoliers> but it maters if you have a slow rising falling edge
[04:43:16] <_abc_> if not possible, then I WILL use something like that
[04:43:17] <langoliers> tt
[04:43:29] <_abc_> langoliers: so slow edges are a problem?
[04:43:30] <_abc_> tt?
[04:43:59] <_abc_> So the Schmitt input represented in the 'General digital IO' diagram is not relevant in hvpp mode?
[04:44:08] <langoliers> yes if you have 10m cable then it will rise slowly
[04:44:22] <_abc_> I do not have a 10m cable but I do have cheap switches which bounce
[04:44:34] <_abc_> and I chose to debounce with RC which slows the edge down
[04:44:48] <langoliers> why on earth you want to program using switches?
[04:44:51] <_abc_> Does this make sense?
[04:45:05] <_abc_> I need to just reset the damn fuses I am awash in serial programmers
[04:45:15] <_abc_> And I will do that using a breadboard
[04:45:54] <langoliers> use a 40106 then and debounce it
[04:46:27] <_abc_> Just answer the original question or say "I don't know" please. I know how to use a 40106 for debouncing but I would like to avoid complexity.
[04:46:53] <langoliers> you can avoid it, and you will see if it does not work i think
[04:47:10] <_abc_> Thank you for saying "I don't know" in a roundabout way, langoliers.
[04:47:29] <langoliers> http://www.atmel.com/Images/doc0943.pdf
[04:47:40] <langoliers> accidentally i am reading this too right now :)
[04:50:00] <_abc_> That document is ancient, and makes no mention of the input type seen on avrs, old or modern, whether they are Schmitt or not, nor does the term 'Rise Time' appear anywhere in it, as it does not in the 168 pdf I used before.
[04:50:32] <langoliers> generally slow rising and falling edges need a schmitt trigger, also, cmos ics don't like to be in the uncertain region for a long time.
[04:59:11] <langoliers> abc where you see schmitt trigger symbols btw ? http://www.atmel.com/Images/doc2545.pdf i only see schmitt triggers mentioned at page 308
[05:00:01] <_abc_> get the 168 datasheet and see page 72, 'General digital IO pin'
[05:00:08] <langoliers> and there are max rise and fall times mentioned, unsure what if it takes longer
[05:00:28] <_abc_> Technically you are right, one should err on the side of caution.
[05:00:42] <_abc_> In practice, it is normal for someone else to have erred for you already (Atmel)
[05:01:00] <_abc_> The 168 datasheet mentions hysteresis on any Schmitt input to be 0.05Vcc
[05:01:02] <_abc_> nominal
[05:01:11] <_abc_> which makes it 250mV for 5V and is okay
[05:04:53] <langoliers> which are the schmitt inputs ?
[05:05:55] <langoliers> oh page 313, i remember this, i was trying to make a hv programmer 10 years ago and failed to comply the timings on win*
[05:08:16] <langoliers> abc have you seen these ? http://denki.world3.net/avr_rescue.html http://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/
[05:08:30] <_abc_> barf
[05:09:32] <_abc_> I'd say overkill but hey it's your project
[05:10:39] <_abc_> Anyway thanks for the link
[05:10:59] <_abc_> I might try it later, for now I drew up a switches-only resetter and a manual sequence chart :)
[05:11:36] <langoliers> ii have doubts you will be able to press the button for 0-1us :)
[05:11:50] <_abc_> Nobody needs to press a button for 0.1us
[05:12:35] <_abc_> Code seems simple enough for the atmega8 based one, nice project
[05:12:40] <_abc_> Thanks for the link, again
[05:12:45] <langoliers> but if i think this over again... some high speed monostable can do that
[05:12:48] <langoliers> ;/
[05:13:07] <_abc_> you only need a series RC differentiatior and a Schmitt
[05:13:14] <langoliers> yeah ;/
[05:13:20] <_abc_> but there is nothing in the sheets about short pulses, you can use switches and fingers
[05:13:27] <_abc_> as long as they do not glitch
[05:13:36] <_abc_> I will read the sheets again to make sure, however
[05:14:12] <langoliers> 200ns is fine for minimum pulse width everywhere
[05:14:25] <_abc_> never say never, never say everywhere
[05:15:00] <langoliers> WR low to RDY/BSY high : 3.7 4.5 ms :) - now this needs a monostable
[05:15:22] <langoliers> and this: WR low to RDY/BSY high for chip erase - 7.5 9 ms
[05:15:36] <_abc_> no, those are internal timings
[05:15:43] <_abc_> the pulse width is not given
[05:15:50] <_abc_> *maximal
[05:16:01] <_abc_> RDY returns high when the internal operation completes
[05:19:13] <langoliers> hm i see they made changes
[05:19:15] <megal0maniac> OndraSter_: How long until I can program your bootloader into coco and try out xide? :D
[05:19:26] <langoliers> i was trying to program the 89c2051 type...
[05:22:23] <OndraSter_> megal0maniac, when my school stops giving me homeworks
[05:23:48] <megal0maniac> No semi-stable dev stuff yet? :P
[05:24:06] <megal0maniac> I'm willing to try anything that won't brick my xboard or computer
[05:24:17] <OndraSter_> nope
[05:25:41] <OndraSter_> THANKS GPROF! everywhere says 0.0
[05:25:55] <_abc_> Did you run the program? :)
[05:26:30] <_abc_> langoliers: 89c2051 needs parallel mode. Try 89s2051 I think
[05:26:41] <_abc_> has spi mode iirc
[05:26:54] <_abc_> er no 89s51, 52 53 have spi
[05:27:48] <KebabBob> Anyone know a 3 wire connector that can be panel mounted? I'm trying to find something suitable for onewire networks that is reasonably compact and makes it easy for me to expand the network..
[05:31:42] <langoliers> _abc_<< i did not have anything else about 10 years ago.
[05:32:16] <langoliers> just wanted to make it work
[05:33:05] <_abc_> http://zoom.mediafax.ro/images/pix.gif note to sargeant: make soldiers keep eyes OPEN while pressing TRIGGER. No exceptions ... :) (North Korean soldiers "training")
[05:33:56] <langoliers> linking fail :)
[05:34:02] <_abc_> hm?
[05:34:08] <_abc_> not the pic I hope
[05:34:09] <langoliers> pixel.gif lol
[05:34:35] <_abc_> http://zoom.mediafax.ro/news/coreea-de-nord-10697258#foto_30 this works
[05:34:58] <_abc_> http://zoom.mediafax.ro/news/coreea-de-nord-10697258#foto_29 and this is the right picture
[05:35:01] <_abc_> #29
[05:35:03] <_abc_> for my comment
[05:35:08] <_abc_> sorry fubard website
[05:37:33] <langoliers> dis ? http://storage0.dms.mpinteractiv.ro/media/1/2181/25666/10697258/5/000-hkg8406943.jpg
[05:37:54] <_abc_> no, the previous one. #29
[05:38:38] <langoliers> http://storage0.dms.mpinteractiv.ro/media/1/2181/25666/10697258/35/000-hkg8369437.jpg
[05:38:52] <_abc_> yes
[05:39:08] <langoliers> oh yea shooting blind is cool
[05:39:10] <_abc_> man on left has eyes closed and trigger pressed
[05:39:41] <_abc_> open eyes to see dead birds dropping from the sky...
[05:40:18] * _abc_ did not serve in any army heh
[10:07:31] <jc5134> just out of curiosity, say I'd like to have an UART receiver that doesn't need to have clkIO when not receiving anything. Anyone tried that with an avr ?
[10:08:17] <jc5134> for example could just setting up an edge interrupt for the start condition an immediately enabling UART receiver work ?
[10:09:09] <Horologium> not sure what you mean there jc5134
[10:09:32] <jc5134> Horologium, basically leaving the UART in a state that's always ready to receive a character but without the main oscillator running
[10:10:07] <jc5134> Horologium, and as soon as start condition occurs somehow reenable clkIO and let the uart module work properly
[10:10:39] <Horologium> you could tie one of the external interrupts to the RX line and have that wake the thing up.
[10:11:00] <jc5134> yep.. but will the UART catch the incoming character when it doesn't sample the incoming start condition edge ?
[10:11:15] <jc5134> probably not, will it ?
[10:11:19] <Horologium> probably not.
[10:11:32] <Horologium> this is what start bits are for though, perhaps?
[10:11:35] <jc5134> that's exactly what I'm curious about. If/how is this possible
[10:12:37] <Horologium> try it and see.
[10:15:28] <timemage> jc5134, do you have control over the other side of the connection?
[10:16:08] <jc5134> timemage, yes.. but lets say I wanted to implement a completely regular RS-232C 8bit 1 stop 1 start bit communication
[10:16:51] <jc5134> maybe its supposed to be solved in the higher level protocol
[10:17:44] <timemage> jc5134, one of the suggestions (with respect to using standby) is to have the host toggle RTS which you feed to INT0, INT1, whatever, to enable the uart.
[10:17:53] <jc5134> for example send 'AT' first, the 'A' gets lost (but triggers and interrupt) and T is used for baudrate detection. From that point on the UART is kept on until either the higher level protocol puts it to sleep or a timeout occurs
[10:18:26] <jc5134> timemage, sounds reasonable :) But noone uses hardware flow control nowadays
[10:19:04] <jc5134> yep I think thats it. Just prefixing commands with 'AT' should probably work
[10:19:16] <jc5134> with a 1-sec timeout or something
[10:19:38] <timemage> jc5134, well, that you could prime it sending <cr> first. that way it's atomic.
[10:21:36] <jc5134> timemage, also good
[10:21:53] <jc5134> thanks for the suggestions :)
[10:22:19] <jc5134> too bad is impossible to do it without any awareness of it in the protocol on an avr.
[10:22:46] <jc5134> or !
[10:23:09] <OndraSter_> if you had xmega you could use i2c... which has got hardware match option, the CPU can be in sleep and on receive condition wake up the device
[10:23:09] <jc5134> receive the first character in a software-based USART implementation that includes baudrate detection
[10:23:19] <jc5134> and then enable USART
[10:23:21] <OndraSter_> (I have not read the backlog)
[10:24:01] <jc5134> OndraSter_ yep, with many protocols its dead simple
[10:24:16] <OndraSter_> no idea if USART can wake up the xmega
[10:25:06] <Tom_itx> why not? you're the xmega expert!
[10:25:36] <OndraSter_> :P
[10:25:42] <OndraSter_> I want SPEED and POWER, not SLEEP!
[10:26:00] <jc5134> OndraSter_ you hate batteries, don't you? :P
[10:26:28] <OndraSter_> yes
[10:27:16] <wondiws> guys, I want to drive a servo on OC3A, but I just can't get it to work, could anyone help me with it?
[10:27:22] <jc5134> I found out that some avrs connected to a lipo battery don't really affect it very much in sleep (including bod) so they can be always powered. That's very cool.
[10:27:35] <jc5134> no need for complex on switches, etc
[10:27:48] <jc5134> and this would actually enable UART communication in this case :P
[10:28:52] <jc5134> the parts with the asynchronnous timers can also power a slow clock crystal and draw next to nothing even with that.
[10:30:59] <jc5134> I think its amazing that the entire avr draws only a little more than a closed P-mosfet in those modes. So the only necessary undervolt protection is not allowing it to wake up until charged :P
[10:45:51] <amee2k> 17:28 < ThatWolfIsASpy> How's my programming? Call 1-800-syntaxerror
[11:11:33] <balance> hi, having an atmega8 with this code http://pastebin.com/qAV6wy9z (sry for german comments, the code isn't from me and they are not needed anyway) i should be able to let a led light up if i put it between pb0 and vcc, shouldn't, I?
[11:12:24] <tomatto> hi
[11:13:15] <tomatto> can i set output to high impedance or open colector?
[11:15:23] <tomatto> collector
[11:30:02] <Horologium> wondiws, what kind of servo?
[11:30:13] <Horologium> balance, not sure, have to look at the code yet.
[11:30:18] <Horologium> tomatto, yes, set it to input.
[11:31:17] <tomatto> Horologium: so switching between input and output by DDR and set output to zero by PORT, is it clean?
[11:31:34] <Horologium> clean?
[11:31:47] <tzanger> tomatto: yes, set it to input. And if you want it OC w/ pullup, turn on the input pullup
[11:32:19] <tomatto> Horologium: good way to do it
[11:32:58] <Horologium> if you want it high impedance, make sure the pullup is disabled.
[11:33:15] <tomatto> tzanger: i need to pull down one input which has 3V and i have 5V power supply, so i must to avoid pull ups
[11:33:22] <Horologium> tomatto, what avr are you using?
[11:33:26] <tomatto> mega8
[11:33:35] <Horologium> let me find the datasheet.
[11:34:15] <tzanger> with a high enough pullup the pin substrate diodes will clamp it and you'll be fine
[11:34:40] <Horologium> atmega8 datasheet page 53
[11:34:49] <Horologium> table of logic levels, including high-Z
[11:36:51] <Horologium> balance, in your code, yes, portB0 should be pulled low so an LED beteen PB0 and VCC should light...if connected the proper direction.
[11:39:53] <tomatto> Horologium: when i want to switch between high Z and low output i will set PORTxn to 0 and switching DDRxn between 0 and 1 right?
[11:40:57] <Horologium> did you read the paragraph just above the chart on page 53 of the datasheet?
[11:41:03] <Horologium> tells you exactly what needs to be done.
[11:42:22] <tomatto> Horologium: yes, i want to be sure i am right
[11:42:38] <Horologium> I already closed the datasheet.
[11:42:40] <Horologium> and am being lazy.
[11:42:49] <Horologium> and currently reading failbook.
[11:44:23] <tomatto> set output to zero and switching between input and output direction is how i see it
[11:45:50] <balance> Horologium: what could be the reason it doesn't? I do have voltage
[11:46:25] <Horologium> balance, put a meter between PB0 and VCC..what does it read?
[11:47:36] <Horologium> voltmeter that is.
[11:50:13] <balance> Horologium: 5v
[11:50:21] <Horologium> then turn your LED around.
[11:51:14] <balance> Horologium: of course i did try that already. It worked in the past when i used a different quarz, but this shouldn't really matter, should it?
[11:51:38] <Horologium> shouldn't
[11:51:45] <Horologium> is the LED burned out?
[11:51:52] <Horologium> or a bad current limiting resistor?
[11:52:33] <Horologium> if you have 5V between the two pins then an LED,,,typically a red LED with a 330ohm or so resistor will light..if connected in the proper polarity.
[11:52:44] <balance> No, they work 100%, tested it elsewhere. I'll rebuilt it quick with different parts
[11:53:00] <Horologium> if the LED is between PB0 and GND it will not light.
[11:53:24] <Horologium> because PB0 should currently be at GND level when set to 0.
[11:53:29] <balance> Horologium: I know,
[11:53:50] <Horologium> if the meter reads 5V then the LED should glow if it's not in backwards or bad.
[11:54:38] <Horologium> if it doesn't then the whole thing is posessed by a windows .dll and you should get a priest or hacker to exercise it for you.
[11:56:51] <Tom_itx> windows exercist
[13:38:53] <mark0> Hey guys, at my EE internship I have been given the duty to "learn" about arm9 through an atmel devkit. We are wanting to use a rtos on it. I have some questions about that
[13:39:28] <mark0> when using a linux based rtos, do you switch from using arm specific code and instead use standard linux libraries? Like if I want to do stuff with ethernet, do I use just standard linux socket libraries
[14:24:58] <district> mark0: hah, you're the guy from reddit!
[14:25:12] <mark0> indeed
[14:27:11] <langoliers> h
[14:33:50] <Eartaker> anyone use the MCP23017?
[14:34:02] <langoliers> microchip
[14:34:04] <Eartaker> or some other I2C chip?
[14:34:10] <Eartaker> I2C
[14:34:31] <Eartaker> Im having some issues with interference I think
[14:35:01] <langoliers> try ethernet with a proper twisted pair, or fiber channel
[15:04:10] <rue_house> ooo ethernet over i2c?
[15:04:18] <rue_house> wait wait I can do better
[15:04:23] <rue_house> ethernet over irda!
[15:04:51] <rue_house> wait! I been beat, avian carriers
[15:05:19] <rue_house> wait, I can beat it, give me a mirror and I'll pulse out some ping frames into space...
[15:05:36] * megal0maniac applauds rue_house
[15:38:13] <sabesto> heh, just installed the "TerminalWindow" extention in AS6.1, anyone used it?
[15:39:01] <sabesto> whats up with it not recognizing \n\r, which makes it kinda useless?
[15:39:15] <sabesto> everything is on one line no matter what
[15:56:39] <kobsu> :D
[16:34:17] <Steffanx> sabesto, abcminiuser is our personal AS assistant. Ask him
[16:35:07] <abcminiuser> I'm chatting to the developer of it now, one sec
[16:37:27] <abcminiuser> "You can't use them in sending, but they are added according to the box thing"
[16:55:16] <sabesto> abcminiuser: this is recieved data
[16:55:59] <sabesto> printf("test\n\r"); all ends up on one line
[16:56:11] <sabesto> repeatedly printing that
[16:56:46] <sabesto> which is a bit messy
[16:57:27] <sabesto> would this qualify as a bug?
[16:57:32] <sabesto> i can just file one
[17:01:29] <sabesto> with support for cr/lf and autoconnect like the bug currently filed it would be a great little tool
[17:11:20] <abcminiuser> Probably, file a bug and Morten will sort it out
[17:13:48] <sabesto> been trying to use ASF lately, found a few bugs in the docs that i might add aswell
[17:13:59] <sabesto> the examples
[17:22:17] <wondiws> I'm still playing with PWM on my atmega2560, but when I enter 1 in the OCR register my motor goes full speed, and 0 off, so I don't benefit much from the pwm...
[17:22:23] <wondiws> any ideas why this might be?
[17:22:46] <wondiws> didn't I configure the prescaler correctly or something?
[17:25:58] <sabesto> what if you enter 100?
[17:26:08] <sabesto> also pastebin code
[17:29:36] <wondiws> oh yeah, 100 is the same
[17:29:39] <wondiws> 60000 is the same
[17:30:33] <wondiws> TCCR4A = (1<<COM4A1);
[17:30:48] <wondiws> TCCR4B = (1<<WGM32) | (1<<CS42);
[17:30:59] <wondiws> OCR4A = 100;
[17:32:36] <sabesto> WGM32 should probably be 42, but that might be the same
[17:32:46] <OndraSter> make sure you are in PWM mode, not in CTC mode
[17:33:25] <wondiws> it is 42 yes
[17:33:37] <wondiws> typo here in the chan, in the code it's 42
[17:33:52] <wondiws> 43 actually...
[17:35:58] <wondiws> so phase and freq correct pwm if I'm correct
[17:37:38] <sabesto> never used that mode, use mode 5-7 instead
[17:37:50] <sabesto> 8 bit is probably enough anyway
[17:38:07] <sabesto> unless you are doing some fanzy stuff
[17:38:16] <wondiws> 8 bit for the timer counter you mean?
[17:38:59] <wondiws> but I think I got it
[17:39:28] <wondiws> I set up the ICR1 register while using timer4...
[17:40:03] <sabesto> TCCR4A |= (1<<COM4A1)|(1<<WGM40); TCCR4B |= (1<<CS42)|(1<<WGM42);
[17:40:35] <sabesto> that + set OCR4A to 100 and the pin as output and it should work
[17:40:48] <wondiws> I'll try
[17:40:55] <wondiws> thanks
[17:44:42] <sabesto> that would be pin PH3
[17:45:02] <wondiws> yes it is :)
[17:46:17] <wondiws> no luck so far
[17:50:45] <sabesto> works for me
[17:53:55] <sabesto> wondiws: http://pastebin.com/AVGNgZcg
[17:59:01] <sabesto> depending on how you connected this you might cause the micro to reset every time it tries to start the motor
[19:39:19] <langoliers> i have assembled a correctly grounded dapa cable, every second wire is gnd, 35pf@20cm between signal and gnd, cool ?
[19:39:56] <langoliers> now it can do ATA100 speed ;<
[19:51:37] <langoliers> the TTL inputs pull 1.5-2mA in the parallel port btw (xilinx engineers do not know this)