#avr Logs

Oct 21 2018

#avr Calendar

05:16 AM nohit: --
07:26 AM _ami_: *_*
10:51 AM rue_bed: ok, so, the next challange is to cough up a 4 channel serial controlled pwm on a tiny13
11:33 AM rue_shop3: yay!
11:34 AM rue_shop3: ok, I moved the timer to a compare match instead of the overflow...
11:35 AM rue_shop3: wow, I'm getting quite a collection of tiny13 programs
12:01 PM rue_shop3: ooooh trickey
12:02 PM rue_shop3: the use of the timer0 as fast pwm screws up the serial, becase it changes OCRx from being immediatly updated to having to wait till top
12:03 PM rue_shop3: so, I have to use software pwm
12:03 PM rue_shop3: which MIGHT screw with my serial still
12:03 PM polprog: what does OCRx have to do with the serial?
12:03 PM rue_shop3: on a tiny13, its the only way I have to know when I have a bit
12:04 PM polprog: a bit in the UDR?
12:04 PM rue_shop3: there is no udr
12:04 PM polprog: interesting
12:04 PM polprog: i mean, i never used a tiny13 so im curious
12:04 PM rue_shop3: its uart-free
12:04 PM polprog: ouch
12:05 PM rue_shop3: I did it tho!
12:05 PM rue_shop3: I managed to code a serial receive!
12:05 PM rue_shop3: and it works, as long as I dont try to turn on fast pwm
12:10 PM rue_shop3: uh
12:10 PM rue_shop3: there is no point using the compare match for the software pwm
12:10 PM rue_shop3: might as well just use the overflow
12:18 PM [1]MrMobius is now known as MrMobius
12:22 PM rue_shop3: oo thats slow pwm
12:42 PM rue_shop3: ok, using the timer for the software pwm clock isn't going to work
12:42 PM rue_shop3: so, the only other timer is the ADC
12:43 PM rue_shop3: yea, 9.6Mhz, /8 for the serial timing, then /256 for the timer rollover, then /256 for the software pwm... only leaves 18Hz
01:18 PM rue_mohr: ok so
01:18 PM rue_mohr: adc
01:18 PM rue_mohr: 9.6Mhz /13 /256
01:18 PM rue_mohr: 2.8Khz, yay, there is some room
01:18 PM rue_mohr: what dividers do we have
01:19 PM rue_mohr: 2, 4, 8
01:19 PM rue_mohr: nice
01:19 PM rue_mohr: /4 should work, that'll leave me 720Hz
01:19 PM rue_mohr: which is fine
01:24 PM rue_mohr: ADCSRA set ADEN, ADIF, ADIE, ADPS1, ADATE, and ADSC
01:25 PM rue_mohr: https://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html
01:25 PM rue_mohr: ADC_vect
01:33 PM rue_shop3: hah that works nicely
01:35 PM rue_shop3: see 'er on the scope
01:36 PM rue_shop3: bj76njhvjhg
01:36 PM rue_shop3: this is not the right program... try that over ...
01:37 PM rue_shop3: 740Hz, the 9.6M must be off
01:38 PM rue_shop3: no glithes tho, this is good
01:44 PM rue_shop3: hahah, it uses 372 bytes of flash!
01:46 PM rue_shop3: well, this bodes well for my 4 channel version
01:46 PM rue_shop3: LeoNerd, what did you use the one you made for?
01:47 PM rue_shop3: I should check and see how much time its spending in interrupts
02:00 PM rue_shop3: sweeeet, first crack at the protocol state machine worked
02:00 PM rue_shop3: insert the other 3 channels....
02:01 PM rue_shop3: ooo 510 bytes!
02:01 PM rue_shop3: thats half the space on the t13!
02:04 PM rue_shop3: #$%@#^@#!%$ whats a freaking IR led doing in there!
02:32 PM rue_mohr: hmm the channels with adc dont work right
02:32 PM rue_mohr: I have to stop using such sensitive leds
03:05 PM davor_ is now known as davor
04:15 PM gruetzkopf is now known as Guest47146
04:18 PM Guest47146 is now known as gruet
04:18 PM gruet is now known as gruetze
04:31 PM LeoNerd: rue_shop3: mine just controls a bedside lamp. Soft glow start/stop basically
05:02 PM polprog: i should mod my existing 4 wire stepper driver to accept uart data, and etherner later
05:04 PM polprog: or just roll a PCB since ive got the hardware part mostly done, id just have to either use a sockrt for the wiznet module or lay out the chip itself along with the ethernet physical layer parts (isolation, chip supplies etc)
05:04 PM polprog: socket*
05:41 PM rue_mohr: adps1 and adps0
08:35 PM rue_mohr: so, the 4 channel pwm on the tiny13 is showing misbehaviour
08:35 PM rue_mohr: I think I overloaded the interrupts
11:18 PM day__ is now known as day
11:43 PM rue_mohr: so, I think I bumped into an issue with one of my tiny13's
11:43 PM rue_mohr: its either got a glitch where it cant update the timer value in an overflow interrupt, or its clock rate is WAY out
11:44 PM rue_mohr: otherwise, the tiny13 4 channel serial code works great
11:44 PM rue_mohr: now I can have DOS control my mowerbot
11:45 PM rue_mohr: cause bit-banging pwm out a parallel port from QBASIC isn't cool
11:46 PM rue_mohr: I suppose it might be an idea to make a 4 channel serial ADC
11:46 PM rue_mohr: THO
11:46 PM rue_mohr: hmm
11:46 PM rue_mohr: oooh cant
11:47 PM rue_mohr: unless I'm daring enough to lose the reset pin
11:47 PM rue_mohr: but I could make a 3 channel
11:48 PM rue_mohr: ok, moving on,
11:49 PM rue_mohr: I need to write some code to render a dx
11:49 PM rue_mohr: dxf