#avr | Logs for 2016-02-13

Back
[02:20:04] <Jartza> Evidlo: modulation code for what?
[02:20:33] <Jartza> in the same git is modem.py
[02:21:02] <Jartza> should be pretty simple to write modulation code based on that
[02:21:24] <Jartza> it you need modulation code for avr
[02:22:36] <Evidlo> Yea I was working on it
[02:23:04] <Evidlo> Finally started working out how timers work, but interrupts aren't working at all for me
[02:23:20] <cehteh> huh
[02:23:36] <cehteh> you need to turn them on :D
[02:24:24] <Evidlo> Well this is what I have http://ix.io/omf
[02:24:45] <Evidlo> Actually, that's a little messed up. Ignore the stuff in the while loop
[02:24:52] <cehteh> meeh .. stop using magic constants :D
[02:25:24] <Evidlo> magic constants?
[02:25:46] <cehteh> TCCR0A = 2 << what is the '2' there
[02:26:08] <cehteh> there are predefined names for the bits
[02:26:09] <Evidlo> Isnt that 0b10
[02:26:16] <cehteh> that makes the code also a but more readable
[02:26:29] <cehteh> TIMSK = (1<<OCIE0A) likle that
[02:26:31] <Evidlo> Hold on a second. This isn't the code I wanted to paste
[02:26:48] <Evidlo> It was clean and then I made a bunch of changes while trying things
[02:27:26] <cehteh> heh
[02:28:03] <cehteh> mhm i think my schedulers code left the realm where it serves as example code some time ago ..
[02:28:14] <Evidlo> http://ix.io/omg
[02:28:27] <Evidlo> also lol 'omg'
[02:30:15] <cehteh> you should/must not reset the counter in the interrupt
[02:30:26] <Evidlo> I needed a way to test it was working
[02:30:26] <cehteh> that would only introduce jitter
[02:30:46] <Evidlo> I guess I couldve toggled some io
[02:31:03] <Evidlo> Anyway, it wasn't getting called. TCNT ran all the way up to 255
[02:31:28] <cehteh> leave the counters free running, you can configure them to wrap around at 255 (the default) or set some arbitary TOP in OCRA
[02:31:42] <cehteh> yeah toggle some io
[02:31:58] <cehteh> setting prescaler to /1024 helps, slow debuggung
[02:32:37] <cehteh> before i had a logic analyzer i also set the main clock to 62.5kHz :D ..
[02:32:45] <cehteh> morse code debugging style
[02:32:47] <lorenzo> uhm, if I have an arduino
[02:32:51] <lorenzo> how can I put avr code on that?
[02:32:57] <lorenzo> I mean, there's an ISP header..
[02:33:07] <lorenzo> but can I use USB too?
[02:33:08] <cehteh> just upload it ..
[02:33:09] <Evidlo> You can use the avr libs in the Arduino ide
[02:33:15] <cehteh> you can even use the arduino bootloader
[02:33:17] <lorenzo> Evidlo: I was trying to avoid that
[02:33:20] <lorenzo> I have my own makefile
[02:33:31] <cehteh> i am doung that all the time
[02:33:32] <lorenzo> and was trying to figure out if I could get the bootloader only via avrdude
[02:33:48] <Evidlo> do you still want the bootloader?
[02:34:01] <cehteh> avrdude -c arduino -p atmega328p -b 57600 -P /dev/ttyUSB0 -B 8 -U flash:w:example.hex:i
[02:34:06] <cehteh> here for example
[02:34:12] <lorenzo> Evidlo: I think I need the bootloader to do that cehteh just said
[02:34:21] <cehteh> you dont need the bootloader
[02:34:34] <cehteh> but as long you have enough space it is convinient
[02:34:42] <Evidlo> what does it even do?
[02:34:55] <cehteh> you can hook up a isp to the right pins an done
[02:35:31] <cehteh> which arduino do you have?
[02:35:43] <cehteh> here its a nano clone
[02:35:54] <lorenzo> same
[02:36:21] <cehteh> so that above is what my makefile calls and workd well (linux)
[02:37:24] <Evidlo> cehteh: so let's say I wanted to toggle some pin after X, Y and then Z clock cycles. Would I just move OCR1A around?
[02:37:46] <cehteh> Evidlo: uhm .. i only do the complicated way here :D
[02:38:05] <cehteh> i have a counter freewheeling (turnaround at 255)
[02:38:19] <cehteh> and a priority queue, with a sliding window implementation
[02:38:51] <cehteh> when some event is due within the next cycle it sets OCRA to wake it up
[02:40:10] <cehteh> actually this ORCA interrupt is a EMTPY_INTERRUPT, only wakes the mainloop .. and in mainloop i check time against the pri-queue and call/pop events from it
[02:40:12] <Evidlo> Doesnt it take many cycles to check the queue for events?
[02:40:21] <cehteh> yeah i dont care
[02:40:35] <cehteh> well not *that* much more
[02:40:58] <cehteh> cpu us 99.7% at sleep :D
[02:41:26] <Evidlo> But doesn't that mess up timinig
[02:41:55] <Evidlo> Like if you need an exact number of cycles between each pin toggle
[02:42:10] <cehteh> events are a little bit late, yes, i plan to add hard realtime later, dont need that yet
[02:42:36] <Evidlo> So for my case, how should I implement this?
[02:42:48] <cehteh> what exactly do you want to do?
[02:43:05] <Evidlo> I'm writing a modulator for Jartza's demodulator
[02:43:16] <Evidlo> http://labs.rakettitiede.com/12kbps-simple-audio-data-transfer-for-avr/
[02:43:20] <cehteh> i mean here its just some alarm clock like thing .. schedule events like blinking LEDs etc
[02:43:37] <cehteh> and the event times are quite precise
[02:44:01] <cehteh> when you want to bitbang some signal you possibly need some stricter timing
[02:44:07] <Evidlo> Also, does a high prescaler value mean your code runs fast relative to the timer?
[02:44:17] <cehteh> yes
[02:44:41] <cehteh> /1024 was only meant for debugging now, later of course you need to adjust it to the speed you need
[02:45:02] <Evidlo> Yes, I think ill be at 64
[02:45:02] <cehteh> but as slow as its acceptable to reduce interrupt load
[02:45:30] <Evidlo> So that should be plenty of time for processing i think
[02:45:33] <cehteh> can you use the USI to generate the signal?
[02:46:16] <cehteh> or do you use the usi on the output side already?
[02:46:23] <Evidlo> Maybe, I don't know what that is
[02:46:33] <Evidlo> Something to do with spi
[02:46:38] <cehteh> hardware assistet bitbanging/serial
[02:46:44] <cehteh> yeah, but more general
[02:46:52] <cehteh> its little more than a shift register
[02:47:15] <cehteh> but at least you can crank out a 8 bit pattern in hardware
[02:47:36] <cehteh> thats waaaay better than timing each bit edge
[02:47:58] <cehteh> but your modem has serial or so too?
[02:48:18] <Evidlo> It needs to spit the bits out the other side to an actual micro
[02:48:30] <Evidlo> Also needs to work both ways, half duplex
[02:48:39] <cehteh> you have only one USI so you need to decide on which side you use that
[02:48:51] <cehteh> while for serial you prolly go for softserial
[02:48:56] <Evidlo> Demodulation is already implemented, so I have to add modulation and a way to switch back and forth
[02:49:12] <cehteh> (USI unfortunally sends the bits on opposite order than serial)
[03:09:45] <Deskwizard> cehteh: good point on the USI polarity, IIRC it is discussed in atmel's app note
[03:20:02] <Jartza> Evidlo: I suggest you first try to get the receiving part working for example from PC :)
[03:20:30] <Jartza> I haven't implemented modulation code for AVR as I didn't need that myself, but should be pretty simple to implement
[03:24:11] <LeoNerd> I don't know why USI doesn't have configurable bit direction
[03:24:19] <LeoNerd> That would have been useful
[03:53:32] <Jartza> yes
[03:53:37] <Jartza> would be
[04:25:43] <friddlex> Hey, question. If I program a certain pin as output like DDRB |= (1<<PB1) and then program the timer0 to output a waveform through this pin
[04:26:06] <friddlex> Will I still be able to manually control the pin with PORTB register while the timer is running?
[04:26:39] <friddlex> On attiny85, pin OC0B
[04:30:18] <friddlex> seems like GPIO commands are ignored while a waveform is being generated
[04:31:30] <friddlex> i.e. whrn the COM0B0 bit is set in TCCR0A, this will have no effect on the pin: PORTB &= ~(1<<PB1);
[05:07:14] <lorenzo> hm, should I have F_CPU in makefile or source?
[05:07:23] <lorenzo> I've noticed that if I have it makefile I have to make clean
[05:07:30] <lorenzo> to rebuild if I change fuses :/
[05:10:06] <cehteh> whatever works for you
[05:29:14] <antto> i usually see F_CPU thrown directly at the compiler with the -D flag
[05:29:40] <antto> some of the avrgcc headers require to know it
[05:31:01] <lorenzo> https://github.com/lcafaro/avr-fun/blob/master/attiny4313/ds18b20_uart/Makefile
[05:31:03] <lorenzo> that's what I'm using
[10:24:33] * sebus is mad on Windows 8.1
[10:26:12] <sebus> "this app can't run on your pc"...
[10:30:25] <Tom_itx> 64 bit?
[10:30:53] <Tom_itx> i'm on 7 and run 2 ver... 32 and 64 bit for compatibility with older programs
[10:31:41] <Chillum> I used to get mad at windows, but one day about 20 years ago I just stopped using it. It has not made me mad since
[10:32:41] <Tom_itx> you're missing out then
[10:32:54] <Tom_itx> there's a whole world of good programs that run on windows only
[10:33:00] <Tom_itx> especially good cad programs
[10:33:56] <CasperAtWork> and yes, windows can be annoying with "this program can not run on this computer", formulated in so many ways...
[10:34:16] <CasperAtWork> or "your PC do not meet the minimum requirement" ... when in fact, it does...
[10:35:04] <CasperAtWork> I get that frequently with drivers... clickclikey on setup.exe... and it don't want... point windows to the folder and it install fine...
[10:41:59] <sebus> Tom_itx ye, 64bit.
[10:42:29] <Tom_itx> sebus i had issues running old 32bit as well that's why i maintain a 32bit version so i can keep using my old programs
[10:42:50] <Tom_itx> however i have some newer 64bit programs i like as well and run a 64bit version for those
[10:43:07] <Tom_itx> so in summary... either let go of the past or live in it forever
[10:43:17] <sebus> I just want to run my multimeter app on this thing.
[10:43:38] <sebus> already copied kb-usb2a cable
[10:43:51] <Tom_itx> that was why i opted for 7 instead of 8... that and the somewhat classic look
[10:44:01] <sebus> (also there's no drivers for OSes like XP and above)
[10:44:18] <Tom_itx> you will lose that in 7 or 8 to a degree
[10:46:44] <sebus> 7 was good, but also problematic with my laptop (from 2014)
[10:47:00] <sebus> yep, no official drivers for nvidia stuff
[11:35:03] <rue_house> I invite you to the world of linux, where hardware support never really goes away
[11:35:15] <rue_house> welcome to the parallel port interface for the AT keyboard :)
[11:44:21] <CasperAtWork> rue_house: and where you can "easilly" abuse the hardware? like convert an ide port into a parallel port?
[11:44:51] <rue_house> ooo pata keybaord, now your thinking!
[11:49:33] <CasperAtWork> lol
[11:50:12] <CasperAtWork> now, try it and see if it work!
[11:56:48] <Shavik> This DRV package looks like it'd be a major pain to solder by hand with an iron..
[12:47:06] <Eddie888> hello
[12:47:22] <Eddie888> why my _delay_ms is totaly not accurate?
[12:47:56] <cehteh> totally?
[12:48:07] <Eddie888> yes
[12:48:11] <cehteh> well first you want to use timer not busy loops
[12:48:17] <Eddie888> ok
[12:48:25] <Eddie888> but i thought for simple tasks i can use delay_ms
[12:48:28] <cehteh> and when it is way off then you didnt set F_CPU correctly
[12:48:30] <Eddie888> and delay_us
[12:48:34] <Eddie888> i did
[12:48:53] <cehteh> it should be reasonable accurate
[12:49:10] <Eddie888> #define F_CPU 16000000UL
[12:49:16] <cehteh> but busy loops suck ... and when there are interrupts inbetwen it will be off
[12:49:27] <Eddie888> i just try to read dht11
[12:49:56] <cehteh> there are libs for that
[12:50:03] <Eddie888> where?
[12:50:46] <cehteh> google?
[12:50:51] <Eddie888> can u show me 1?
[12:51:02] <Eddie888> not for arduino i mean
[12:51:07] <cehteh> also i'd prefer some hardware assisted lib for that
[12:51:40] <Eddie888> so there are lib that not for arduino?
[12:51:43] <cehteh> possibly you can use the UART for it, or at least the capture unit
[12:52:05] <Eddie888> dht is not serial
[12:52:20] <cehteh> i know
[12:53:16] <Eddie888> so?
[12:53:20] <Eddie888> do u have lib?
[12:54:07] <cehteh> no
[12:54:19] <Eddie888> do u know lib?
[12:54:48] <rue_shop3> ed209?
[12:55:14] <Eddie888> ?
[12:55:51] <cehteh> just google .. if you dont find a lib then hack your own
[12:56:07] <cehteh> but better use timer/capture unit to acquire the signals
[12:56:22] <cehteh> with some hacks using the UART might be useable too
[12:56:36] <cehteh> check datasheet about the signals/protocolls
[12:56:46] <Eddie888> why? is this sensor so rare?
[12:56:49] <Eddie888> nothing ready?
[12:57:10] <cehteh> people telling dht11 performs really poor, close to unuseable
[12:57:22] <cehteh> dht22 ought to be a bit better
[12:57:41] <cehteh> maybe (quite likely) there are libs out there
[12:57:42] <Eddie888> and lib?
[12:57:44] <Eddie888> any lib?
[12:57:53] <cehteh> shall i google for you?
[12:58:04] <Eddie888> let see if u can find
[12:58:32] <cehteh> http://moretosprojects.blogspot.de/2014/01/dht22-interrupt-driven-library-for-avr.html
[12:58:34] <lorenzo> if the delay is done with interrupt on timer it may not be accurate as you go up with time
[12:58:43] <lorenzo> since there's less resolution
[12:58:53] <cehteh> lorenzo: huh what?
[12:59:22] <cehteh> timers are what you use for that, they are a uninterrupted, precise time source
[13:00:11] <lorenzo> yeah but don't you lose resolution when you set a prescaler?
[13:00:35] <lorenzo> ah well probably not in a way that would affect a sensor read
[13:00:39] <cehteh> just run it at the speed you need
[13:00:46] <tpw_rules> it doesn't become less precise
[13:01:12] <tpw_rules> you just can't specify your desired delay as precisely
[13:01:19] <lorenzo> well it fires always at the same time with the same error, sure
[13:01:20] <tpw_rules> but it will still always match your delay exactly
[13:01:30] <cehteh> lorenzo: huh?
[13:01:42] <cehteh> the timer is as precise as your crystal
[13:02:20] <cehteh> and error? if you make it interrupt driven it may take some time to handle the interrupt, but thats well documented
[13:02:37] <tpw_rules> which is variable by the way
[13:02:46] <cehteh> you can substract that static error
[13:02:53] <tpw_rules> it can't interrupt in the middle of an instruction, so you could be off by a couple cycles on longer instructions
[13:03:28] <lorenzo> hmm but let's say you want a 1 second delay, you set a timer with /1024 prescaler, so that its tick period is e.g. 0.001024s
[13:03:40] <lorenzo> you can't make an exact 1 second delay out of 0.001024s steps
[13:03:44] <lorenzo> that's what I meant
[13:03:45] <cehteh> if you need *that* high precision, let it interrupt soon enouhg (little earlier) and then busy loop on the counter register to the exact desired time
[13:04:12] <cehteh> lorenzo: then you need a proper clock which is divisible to 1s steps
[13:04:27] <cehteh> thats why ther 32.768 kHz watch crystals
[13:04:33] <lorenzo> yeah
[13:04:44] <lorenzo> since 2^15 I guess ?
[13:04:50] <cehteh> halt moment .. 16mhz is divisible to 1s too
[13:05:06] <cehteh> 16000000 steps per second
[13:05:15] <cehteh> so whats the problem?
[13:05:57] <lorenzo> hm are you sure about the 16 MHz thing?
[13:06:18] <tpw_rules> yeah
[13:06:22] <tpw_rules> 16MHz/1024 is 15625
[13:06:28] <tpw_rules> which is within the range of the 16 bit timer
[13:06:29] <cehteh> why 1024?
[13:06:37] <cehteh> the divider doesnt matter much
[13:06:51] <tpw_rules> if you want an interrupt exactly every 1 second
[13:06:59] <cehteh> you can time years long timespans with a 8 bit timer
[13:07:15] <tpw_rules> if you interrupt and count down another counter
[13:07:16] <cehteh> just add a external counter which you increment in the timer overflow interrupt
[13:07:57] <lorenzo> so I guess if you want to do it with hardware counters / timers you keep track of which one overflowed
[13:07:59] <cehteh> the only problem with smaller prescalers is that you get a shitload of interrupt load incrementing this counter when you only use 8 bit timers
[13:08:00] <lorenzo> and go to the next one?
[13:08:11] <cehteh> next one?
[13:08:26] <tpw_rules> each timer has its own interrupt
[13:08:42] <cehteh> the trick is to leave the timer running, never stop it
[13:09:04] <lorenzo> ahh so you keep it running knowing how long does it take to overflow, and use that overflow interrupt to count?
[13:09:20] <cehteh> http://public.pipapo.org/pulseview2.png
[13:09:20] <tpw_rules> yes
[13:09:31] <lorenzo> aha, makes sense, thanks
[13:09:33] <cehteh> just have that on the server . look:
[13:09:37] <tpw_rules> so that no matter how long your interrupt takes (or the jitter), you're never off more than a couple cycles
[13:09:48] <cehteh> channel 5 is a led blinking at 4hz
[13:10:01] <cehteh> channel 3 are the timer0 overflows
[13:10:19] <cehteh> and channel 2 are when the cpu gets waken up ..
[13:10:39] <cehteh> (compare/match unit)
[13:10:52] <tpw_rules> what program are you using? does it interface directly to a saleae or is that just the file name
[13:11:23] <cehteh> you see that there a lot overflows, and when switching the led is due a compare match interrupt is placed at the correct value to toggle the leds state
[13:11:41] <cehteh> tpw_rules: pulseview from sigrok
[13:12:00] <lorenzo> you're going in and out of SMCR (SE) on interrupt?
[13:12:12] <cehteh> SMCR?
[13:12:13] <tpw_rules> ah so you're calculating the compare value at each toggle
[13:12:22] <tpw_rules> cause the compare interrupt seems to be drifting relative to overflow
[13:12:36] <lorenzo> sleep mode control register -> sleep enable
[13:12:43] <cehteh> there is a priority queue, holding the next event in wall time
[13:13:14] <cehteh> lorenzo: yes when channel 2 is off the mpu sleeps
[13:13:52] <cehteh> tpw_rules: actually the comparematch interrupt is a empty interrupt, only used for waking the main loppl
[13:14:17] <cehteh> which then checks the queue
[13:14:34] <tpw_rules> but this means the timer0 isn;'t running at some multiple of 4mhz?
[13:14:37] <tpw_rules> 4hz
[13:14:40] <cehteh> same for overflow, it only increments the global counter, nothing else
[13:15:29] <cehteh> its 16mhz/1024
[13:15:45] <tpw_rules> i don't understand why the compare interrupt for the 4hz led is drifting then
[13:15:50] <cehteh> but overflow is every /256 .. 61.035156
[13:15:57] <tpw_rules> oh
[13:16:06] <tpw_rules> yeah that makes snese nvm
[13:18:09] <cehteh> well just meant as example that one could make a timer/clock which has years long range out of 8bit timers
[13:19:33] <cehteh> http://git.pipapo.org/?p=muos;a=blob;f=PLAN.org#l81
[13:19:42] <cehteh> .. there are some example calculations
[13:50:48] <Eddie888> so what do u suggest for simple dht11?
[13:58:21] <Eddie888> ok
[13:58:25] <Eddie888> i'll just write it
[13:58:49] <Eddie888> anything ready for esp8266 ?
[16:28:01] <WormFood> http://wormfood.net/avrbaudcalc-testing.php <-- If anyone wants to check out my work in progress. Comments or suggestions are welcome. (Ignore problems with the colors, and U2X=1 mode; I'm working on those parts)
[18:19:06] <Deskwizard> WormFood: nice :)
[18:19:08] <Deskwizard> I likey
[18:19:22] <Deskwizard> fits my screen better now :) ty
[18:50:14] <WormFood> it should fit the same as before.
[18:55:45] <WormFood> I made the tables float a while back. Maybe 2 years ago (I'd have to check my changelog)
[18:56:24] <WormFood> I was thinking about adding an option, to display the actual bit rate, in addition to the desired bit rate.
[19:48:52] <Deskwizard> must have been my browser messing things up then heheeh, Oh very good idea!
[19:49:01] <Deskwizard> can I make a suggestion?
[19:49:37] <Deskwizard> you could add the actual compensated value of UBBR required to be close as possible to the real speed you want maybe?
[19:49:42] <Deskwizard> just throwing that in the air
[19:50:38] <Deskwizard> unrelated: who was it, I think it was one of you guys, that told me the trick for 2mm male headers, remove the plastic parts from half a 2.54 mm female header cable ?
[19:50:53] <Deskwizard> I wanna give credits, cause I just used that in my TV hacking endeavour :)
[19:51:33] <Deskwizard> as usual, they forgot to put all the connectors inside it... *shake head* lol
[19:52:02] <Deskwizard> I'll give you guys all the details when I know a little more hehe
[19:52:34] <WormFood> what do you mean?
[19:52:42] <WormFood> compensated UBBR values?
[19:53:29] <Deskwizard> how could I explain... (well maybe it already does that too hehe)
[19:53:32] <WormFood> I calculate UBBR down to a fraction. Then round up or down, according to the accepted rules of math. That is how I generate the UBRR
[19:54:04] <WormFood> [09:24:42] <Deskwizard> you could add the actual compensated value of UBBR required to be close as possible to the real speed you want maybe? <-- That's the whole idea of the program
[19:54:25] <Deskwizard> WormFood: yeah, I looked at the values and you're doing the best you can lol sorry about that
[19:54:54] <Deskwizard> I was thinking with the % of error, maybe we could somehow make math to tweak closer to 0, but yeah, you do that already
[19:55:02] <Deskwizard> sorry, the TV thing got me way too excited
[19:55:17] <Deskwizard> good thing I measured first, I could have killed the thing :|
[19:55:44] <WormFood> There is a "bug" in the datasheets, and some headers, calculate the UBRR value for you incorrectly, always rounding down. My calculator *never* had that problem, as the way I do it now, is the way I've always done it.
[19:56:01] <WormFood> Deskwizard, if you mouse-over the error %, it will tell you the actual bit rate
[19:57:01] <Deskwizard> o.O
[19:57:45] <Deskwizard> I'll be effin damn
[19:58:01] <Deskwizard> you should put that at the top of the page man
[19:58:08] <Deskwizard> I used your site for years, I never noticed that !
[19:58:21] <Deskwizard> wow, thats... awesomer than it already was hehehe
[19:58:38] <Deskwizard> if thats even a word (probably is with reality tv and all the idiots...)
[20:01:51] <WormFood> Deskwizard, I *just* added that.
[20:01:58] <WormFood> It's ONLY in this testing version.
[20:02:12] <WormFood> I just now, updated the testing version again. The colors should all be correct now.
[20:02:31] <Deskwizard> Oh okay, pfew
[20:02:41] <Deskwizard> I was like, damn I missed out big ime for all those years?
[20:02:51] <Deskwizard> its really nice WormFood, honest :)
[20:02:54] <Deskwizard> I love :)
[20:02:56] <WormFood> I was thinking about adding a checkbox, to add the actual bit rate values, to the table, so users with touch screen devices (who can't mouse-over), can also get that info, if they want/need it.
[20:03:04] <Deskwizard> for what little its worth ... hehe
[20:03:23] <WormFood> I think it's good information to have, just to be complete.
[20:03:24] <Deskwizard> WormFood: I'd appreciate that very much if its not too much trouble for you
[20:03:50] <Deskwizard> yeah I agree, I love completeness :) makes the difference between my bookmark and the next site ;)
[20:04:15] <WormFood> Also, notice the new drop down select list, for your number of bits. That affects the colors on the table. Change it from 5 to 10, to biggest change in the colors on the table.
[20:05:03] <WormFood> anything in green, is within Atmel's recommended maximum error rate.
[20:05:57] <WormFood> yellow is between their recommended max error rate, and absolute max error rate, and orange is the other side up to the error rate....outside of that absolute maximum error rate, is in red.
[20:06:09] <WormFood> And, anything outside of 15% error, is shown in gray
[20:06:35] <Deskwizard> yeah I loved your color coding from the start, easy to see at first glance, I like that, no need to squint and read for 10 minutes
[20:06:37] <Deskwizard> :)
[20:06:43] <WormFood> The actual bit rate vaules being added to the tables, was something I was thinking about adding. I'm glad it's a feature you want.
[20:07:34] <WormFood> When I was working on the colors, they were gone, and I was surprised how hard it is to absorb the information. The colors really do make it easier to know what's good, and what isn't, at a glance.
[20:08:33] <WormFood> I'm also gonna add an option to remove the color, and make it just black and white. I expect that may be handy for people, that for whatever reason want to print out the table.
[20:09:37] <Deskwizard> Very good idea indeed
[20:09:51] <Deskwizard> I have to say, I like your attention to details like that, I like that.
[20:09:55] <WormFood> I gotta go to bed. Chat later Deskwizard. Thanks so much for the feedback. I'm happy to know my additions and changes are welcome.
[20:09:58] <Deskwizard> half-baked shit pisses me off
[20:10:04] <WormFood> Agreed.
[20:10:10] <Deskwizard> 'later WormFood, thanks for all the good work, sleep well
[20:10:24] <WormFood> A calculator that doesn't work at all, is better than one that doesn't do what you need.
[20:10:43] <Deskwizard> I would make an chinese SoC here, but I dont know who's in what channel, so I'll just keep it to myself :P~
[20:10:56] <Deskwizard> WormFood: I agree, same for one that five you bad values
[20:11:04] <Deskwizard> so fix that bug!
[20:11:06] <Deskwizard> lol jk :P
[20:11:18] <WormFood> When it doesn't work, you KNOW it doesn't work, and can do it manually. But when you think you have a tool, and it doesn't work, you waste time with it. It would have been better to have nothing in that.
[20:11:58] <WormFood> I've tried to make sure that my values are 100% correct.
[20:12:23] <Deskwizard> LOL thats exactly why I ditched the arduino IDE at least now when its not working, I know its my fault and not someone else's :P
[20:12:53] <Deskwizard> WormFood: re bugs: I know I'm just messing with you because you mentionned a bug earlier :P
[20:12:54] <WormFood> If it spews out wrong values, that'd be a disservice, and cause problems for people, and would taint the image of my calculator. Of course it has bugs, but never found one with the UBRR values.
[20:13:16] <Deskwizard> WormFood: bugs are well, bugs... they a fact of life
[20:13:19] <WormFood> I found several bugs in my code. But nothing critical.
[20:13:26] <Deskwizard> you can try as hard to exterminate, doesnt always work :P
[20:13:30] <WormFood> I think I got 'em all squashed now.
[20:13:32] <Deskwizard> at least in my experience lol
[20:13:39] <Deskwizard> congrats :)
[20:13:44] <WormFood> And I'm really happy with the new look (more gray)
[20:14:06] <WormFood> And I'm happy, that the color codes, are more useful, combined with the number of bits+parity.
[20:14:19] <WormFood> number of data bits.
[20:14:26] <WormFood> Anyways, I'm out. See ya l8r.
[20:15:37] <Deskwizard> thats why it seemed cleaner !
[20:15:44] <Deskwizard> you tricky bastard ;)
[20:15:48] <Deskwizard> 'aight, later
[20:20:18] <Alex1992> Hi, does anyone know the -p code for a 40 pin atmega16?
[20:20:56] <Alex1992> It's not m16, the avr programmer won't handshake with the IC with that code
[20:21:29] <Lambda_Aurigae> guessing you mean the code for avrdude?
[20:21:42] <Alex1992> lambda: yeah, exactly
[20:22:04] <Lambda_Aurigae> should be m16.
[20:22:11] <Lambda_Aurigae> it is according to avrdude.conf file.
[20:22:23] <Alex1992> even with 40 pins, not to 28 pin version?
[20:22:32] <Lambda_Aurigae> will be the same for the atmega16 no matter how many pins.
[20:22:40] <Lambda_Aurigae> there is no atmega16 with 28 pins.
[20:22:48] <Lambda_Aurigae> atmega16 is 40 or 44 pin.
[20:22:52] <Lambda_Aurigae> depending on the package.
[20:23:17] <Lambda_Aurigae> there is an atmega168 in 28pin.
[20:23:50] <Lambda_Aurigae> oh, wait, it's 32 pin, not 28
[20:24:16] <Lambda_Aurigae> hmm..guess it's both.
[20:24:20] <Alex1992> I've got a 28 pin in front of me, haha
[20:24:21] <Lambda_Aurigae> 32pin tqfp and 28pin dip
[20:24:25] <Lambda_Aurigae> atmega168
[20:24:31] <Lambda_Aurigae> that's different from atmega16
[20:24:48] <Alex1992> i accidentally ordered this intead of the 40 pin.
[20:25:07] <Alex1992> Oh, that's interesting. I assumed the 8 at the end just meant 8 bit
[20:25:14] <Lambda_Aurigae> there is no 28pin atmega16
[20:25:17] <Lambda_Aurigae> no.
[20:25:21] <Lambda_Aurigae> that's a different chip.
[20:25:55] <Alex1992> ok, thanks for the info. Kinda a bummer they're so closer together in name
[20:26:30] <Alex1992> But, I do have a atmega16 proper, and avrdude is not talking with it. Do you know of a way to see if it is DOA?
[20:26:32] <Lambda_Aurigae> both avr core
[20:26:44] <Lambda_Aurigae> test it.
[20:26:56] <Lambda_Aurigae> hook it to an HVPP programmer and see if it responds.
[20:28:44] <Lambda_Aurigae> maybe connect a 1MHz clock source to it and try to read it with your regular programmer.
[20:28:54] <Lambda_Aurigae> depends on why it is not functioning.
[20:29:40] <Alex1992> I don't have a hvpp nor an waveform generator to do any of that unfortunately
[20:30:01] <Alex1992> Just starting to do electronics, so I'm pretty barebones.
[20:30:17] <Lambda_Aurigae> you have another AVR, yes?
[20:30:35] <Lambda_Aurigae> use it to generate a 1MHz signal on a gpio pin and feed that to the clock input pin on the atmega16.
[20:30:55] <Alex1992> ohh, that's a nifty idea, ok
[20:30:55] <Lambda_Aurigae> or build a fusedoctor from another avr and use that to reset the atmega16
[20:31:14] <Alex1992> what should happen to the atmega16 when i'm feeding it that signal
[20:31:51] <Lambda_Aurigae> well, depending on what you did, you might have borked the clock source.
[20:32:14] <Lambda_Aurigae> by feeding a 1MHz clock stream into the clock input, you should be able to reprogram the chip.
[20:32:22] <Lambda_Aurigae> by fixing the fuses that might be borked.
[20:33:30] <Alex1992> The only thing i've done so far is plugged it into the socket, where i'd just programmed an atmega32 successfully. So from package to socket immediately, and it never worked. No recognition at any time
[20:33:44] <Alex1992> could the shift from atmega32 to m16 have screwed it up?
[20:33:54] <Lambda_Aurigae> and you are sure it is an atmega16 and not something else with similar numbers?
[20:35:04] <Alex1992> The thing printed on the chip is "atmega16-16pu"
[20:35:12] <Lambda_Aurigae> then it is that.
[20:35:17] <Alex1992> is the 16pu maybe something else?
[20:35:22] <Lambda_Aurigae> no.
[20:35:32] <Lambda_Aurigae> that just means 16MHz and the dip package.
[20:35:41] <Alex1992> dang, ok
[20:35:46] <Lambda_Aurigae> you might try slowing down your programmer speed.
[20:35:52] <Lambda_Aurigae> and read the datasheet
[20:36:02] <Lambda_Aurigae> because many of your questions would be answered by doing so.
[20:36:14] <Lambda_Aurigae> right down to and including the numbering scheme on the chip.
[20:36:29] <Alex1992> when you say slow down, do you mean baud rate or bit rate?
[20:36:36] <Alex1992> i've tried the -b and -B changes
[20:36:42] <Lambda_Aurigae> bit rate that it programs at.
[20:36:55] <Lambda_Aurigae> and does your programmer actually support slowing down the bit rate?
[20:37:06] <Alex1992> yeah, i can slow down with the m32
[20:37:47] <Lambda_Aurigae> does slowing it down actually slow it down though?
[20:38:13] <Alex1992> yeah, a 20 s upload will be much faster with a -b 1 in the line
[20:38:23] <Alex1992> down to like 8s
[20:38:37] <Lambda_Aurigae> ok...because some cheap programmers will accept the commands but not do anything with them.
[20:38:54] <Alex1992> yeah, that's good to know, but i don't think that's the case with this one
[20:39:20] <Lambda_Aurigae> specially anything usbasp based....you have to get newer firmware than what ships on most of the chinese cheapy ones.
[20:39:43] <Alex1992> yeah, this is a sparkfun pocket programmer, been doing pretty well with the m32
[20:40:09] <Alex1992> although the "no power" button doesn't work and still provides a 4V output in that mode
[20:40:49] <Lambda_Aurigae> yup
[20:40:54] <Lambda_Aurigae> that's a usbasp based programmer.
[20:40:58] <Lambda_Aurigae> just one of the higher end ones.
[20:41:04] <Alex1992> That had me worried since my load can pull quite a bit of current, and I didn't want to fry my usb port
[20:41:09] <Lambda_Aurigae> still not a high grade programmer.
[20:41:30] <Lambda_Aurigae> uses an attiny2313 running v-usb based usbasp software.
[20:43:27] <Lambda_Aurigae> holy snotbuckets..they don't even protect the usb port from 5V...that thing could damage a usb port.
[20:43:27] <Alex1992> and that's not ideal apparently
[20:44:01] <Lambda_Aurigae> D+ and D- are fed 5V through 27 ohm resistors on that board.
[20:44:22] <Lambda_Aurigae> no zener diodes to protect like should be done.
[20:44:24] <Lambda_Aurigae> I wouldn'
[20:44:30] <Lambda_Aurigae> I wouldn't plug that thing to my computers.
[20:46:22] <Alex1992> would the .5A fuse on Vbus not stop that?
[20:46:48] <Lambda_Aurigae> nope.
[20:47:01] <Alex1992> I was initially worried, but the sparkfun rep said the fuse would protect the port
[20:47:08] <Lambda_Aurigae> D+ and D- are not necessarily 5V compliant.
[20:47:24] <Lambda_Aurigae> the fuse just protects you from drawing too much current from VBUS
[20:47:43] <Lambda_Aurigae> usb provides 5V power out on VBUS.
[20:47:52] <Lambda_Aurigae> but the data lines are not supposed to have 5V fed to them.
[20:48:09] <Lambda_Aurigae> they are 3.3V levels.
[20:48:22] <Lambda_Aurigae> two different problems there.
[20:49:12] <Lambda_Aurigae> there is no voltage regulator so the attiny2313 runs at 5V and the USB communications lines run at 5V...this is a poor design and can damage a usb port.
[20:49:19] <Alex1992> so you're saying that the low resistor value could drive up the D- and D+ up beyond 3.3V with a large draw?
[20:49:25] <Lambda_Aurigae> I would recommend only running it through a usb hub.
[20:49:40] <Lambda_Aurigae> I'm saying that your voltage on D+ and D- is 5V!
[20:50:29] <Lambda_Aurigae> the chip puts out 5V...it goes through a 27ohm resistor according to the schematic....
[20:51:02] <Lambda_Aurigae> that is not going to drop 5V down to 3.3V
[20:51:26] <Lambda_Aurigae> there should be 3.3V zener diodes between the data lines and GND.
[20:52:44] <Lambda_Aurigae> so, be safe, use protection....a usb hub.
[20:55:06] <Alex1992> Hey, sorry I
[20:55:18] <Alex1992> 'm looking through usb info, trying to learn it
[20:56:05] <Lambda_Aurigae> I spent last sunday building usb interfaced avr programmers from pic16f1455 chips.
[20:56:43] <Lambda_Aurigae> one chip, one cap, home made circuit board, and some wires.
[20:58:33] <Lambda_Aurigae> https://hackaday.io/project/6258-two-component-usb-temperature-data-logger based off this.
[20:58:52] <Alex1992> I haven't found anything that says D- and D+ are 3.3V though, but then I don't even understand how the differential can make 1 and 0 yet.
[20:59:22] <Alex1992> oh nvm, just found it
[21:00:28] <Alex1992> was that just to pass some time for a sunday?
[21:01:43] <Alex1992> haha, that's an interesting looking usb
[21:04:31] <Lambda_Aurigae> I'm building tools for this summer's robotics and electronics class I'm teaching.
[21:04:35] <Lambda_Aurigae> just had 8 kids sign up.
[21:04:43] <Lambda_Aurigae> plus the 3 repeats from last summer.
[21:06:14] <Alex1992> nice, what grade level?
[21:06:30] <Lambda_Aurigae> age 10 to 18
[21:06:41] <Lambda_Aurigae> at least, that's what I have had in the past.
[21:06:59] <Lambda_Aurigae> it's not an official school or anything...just me teaching local kids out of my workshop.
[21:07:10] <Lambda_Aurigae> kind of a mini-hackerspace.
[21:07:26] <Lambda_Aurigae> me, my junk, and some kids who want to learn something.
[21:08:05] <Lambda_Aurigae> and, by junk, I mean lots of electronics junk, much of it torn out of old copiers and printers.
[21:08:23] <Lambda_Aurigae> best source of robotics bits-n-pieces I've ever found.
[21:08:49] <Alex1992> word, that sounds like a lot of fun. I've done stem tutoring for some years, and always had a great time
[21:08:51] <Lambda_Aurigae> and free, for me at least, as I fix copiers and printers for a living so have access to the copier graveyard.
[21:09:19] <Lambda_Aurigae> I also get plenty of free stuff from multiple manufacturers, specially when I tell them what it's for.
[21:09:43] <Deskwizard> yeah, you want gears and sensors and stuff, get a old color laser all in 1 from HP, like 2820 or something
[21:09:48] <Lambda_Aurigae> my atmel rep is sending me 4 xmega boards next month.
[21:09:53] <Deskwizard> damn do they cram A LOT in there hehe
[21:09:56] <Deskwizard> Lambda_Aurigae: nice :)
[21:10:01] <Lambda_Aurigae> screw hp.
[21:10:05] <Lambda_Aurigae> I get xerox gear.
[21:10:23] <Deskwizard> Lambda_Aurigae: it was just an example, good idea with the xerox, likely way sturdier
[21:10:25] <Lambda_Aurigae> I have 8 xerox solid ink copiers in my garage right now to tear apart...identical machines.
[21:10:39] <Deskwizard> I was just surprised at the size of the original machine VS pile of junk hehe
[21:10:50] <Lambda_Aurigae> and 9 identical old okidata ml320 printers too.
[21:10:57] <Deskwizard> Lambda_Aurigae: you not looking to sell one of those solid inks are you ?
[21:11:03] <Deskwizard> I could use one of those
[21:11:09] <Lambda_Aurigae> they are all junk...all the printheads are fucked.
[21:11:15] <Deskwizard> oh okay
[21:11:30] <Deskwizard> the okidata, they some weirdish laser-like LED something, right?
[21:11:35] <Lambda_Aurigae> printhead/reservoir unit is about 1500 USD my cost.
[21:11:41] <Deskwizard> or they just laser printers they hyped in ads? :P
[21:11:52] <Deskwizard> outch yeah nvm, ill hack a old inkjet instead hehe
[21:11:55] <Lambda_Aurigae> no..the ml320 is an old impact printer..what people call a dot matrix printer.
[21:12:00] <Deskwizard> Oh dot matric!
[21:12:03] <Deskwizard> matrix*
[21:12:05] <Lambda_Aurigae> but,
[21:12:08] <Deskwizard> I need one of those
[21:12:14] <Deskwizard> ah damn I did it again
[21:12:18] <Lambda_Aurigae> ALL PRINTERS are dot matrix except pin plotters.
[21:12:21] <Deskwizard> s/need/want
[21:12:27] <Deskwizard> Lambda_Aurigae: LOL good point
[21:12:38] <Lambda_Aurigae> laser, inkjet, impact,,,,all print a matrix of dots.
[21:12:42] <Lambda_Aurigae> they just do it differently.
[21:12:44] <Deskwizard> I'll call them impact printers from now on, if I slip, slap me :P
[21:12:48] <Lambda_Aurigae> I will!
[21:12:53] <Lambda_Aurigae> :}
[21:12:57] <Deskwizard> you're name isnt Paul is it?
[21:13:00] <Deskwizard> lmao
[21:13:10] <Lambda_Aurigae> Nope.
[21:13:32] <Deskwizard> ah sorry mate, I was sure my friend was in here too, it was an joke between us two
[21:13:58] <Lambda_Aurigae> I'm not even British or Aussie.
[21:13:58] <Deskwizard> I appreciate uhm.. how would you say... (im sorry english aint my native language) .. precision ?
[21:14:04] <Lambda_Aurigae> Just good old 'merican.
[21:14:13] <Deskwizard> hi HA! :P~
[21:14:30] <Lambda_Aurigae> the old impact printers were very well made.
[21:14:36] <Deskwizard> Indeed
[21:14:39] <Lambda_Aurigae> these are at least 20 years old and still work.
[21:14:53] <Lambda_Aurigae> but, within the next month they will be parts-in-bins
[21:15:07] <Lambda_Aurigae> awaiting being turned into a 3D printer/eraser
[21:15:13] <Lambda_Aurigae> most likely a 3D eraser.
[21:15:15] <Deskwizard> I saw something the other day I was interested in as well, the ones before the dot-impact printers, they did characters on a wheel... daisy printers?
[21:15:18] <Deskwizard> something like that
[21:15:21] <Lambda_Aurigae> also known as a 3d milling machine.
[21:15:27] <Lambda_Aurigae> daisy wheel.
[21:15:37] <Deskwizard> my plan is PCB making machine, I hate waiting 2 weeks hehehe
[21:16:04] <Deskwizard> Lambda_Aurigae: yeah those, Im very interested in getting my hand on one of those, probably going to be expensive unless I luck out
[21:16:11] <Lambda_Aurigae> not as much on the precision positioning for a daisy wheel unit as it only had to position for character spacing where impact matrix printers positioned for pixel spacing.
[21:17:09] <Lambda_Aurigae> brother hr-25 daisy wheel printer...$12.50 USD on ebay.
[21:17:26] <Lambda_Aurigae> some go much higher.
[21:18:16] <Lambda_Aurigae> check with banks and insurance companies as they upgrade old gear.
[21:18:19] <Deskwizard> Lambda_Aurigae: woah, that low? aight, im putting it on my next ebay spree, I'm overdue but no time lol
[21:18:25] <Lambda_Aurigae> many will let you haul that stuff off for free.
[21:18:36] <Lambda_Aurigae> that's how I got the ml320 units.
[21:18:36] <Deskwizard> yeah here we have the auctions from the goverment, stuff they sell
[21:18:42] <Deskwizard> and new budget is soon...
[21:18:47] <Deskwizard> *rool eyes*
[21:18:53] <Deskwizard> im sure ill grab something nice this year lol
[21:19:02] <Lambda_Aurigae> a customer of mine was replacing them...I offered to haul them off and dispose of them free.
[21:19:15] <Deskwizard> lol I used to do that too all the time, man did I get some stuff
[21:19:25] <Deskwizard> repurposed a lot of old pc that would have dies otherwise
[21:19:30] <Lambda_Aurigae> many places also have electronics disposal days once a year or so.
[21:19:33] * Deskwizard is a compu-tarian :P
[21:19:36] <Lambda_Aurigae> get to know the people who run those.
[21:19:47] <Deskwizard> we have drop-box here in any major electronic stores...
[21:19:48] <Lambda_Aurigae> they will often let you dig through and pull useful stuff out of the pile.
[21:19:55] <Deskwizard> I just havent got the balls to steal the box :P
[21:19:55] <Deskwizard> lol
[21:19:58] <Deskwizard> jk
[21:20:11] <Lambda_Aurigae> one of my customers is a local phone company.
[21:20:15] <Deskwizard> well, kidding about the steal, its true I dont have the balls lol
[21:20:20] <Lambda_Aurigae> they let me dig through the cellphone recycle box when I go in there.
[21:20:22] <Deskwizard> Lambda_Aurigae: you lucky bastard!
[21:20:30] <Deskwizard> I envy you SO much
[21:20:40] <Deskwizard> hey... can I PM you? :P~
[21:20:43] <Lambda_Aurigae> have pulled out 5 working android phones and 2 working iphones.
[21:20:51] <Lambda_Aurigae> sure.
[21:21:28] <Lambda_Aurigae> sold the iphones for $20.00 each as I have no use for iCrap.
[21:21:53] <Lambda_Aurigae> the android phones have become security cameras and mp3 players for office, truck, and workshop.
[21:22:28] <Lambda_Aurigae> so easy to turn a working cellphone into a wifi connected security camera with integrated battery backup(if the battery is still good)