#avr Logs

May 19 2019

#avr Calendar

02:31 AM zap0: 328p programming... tried arduino serial.begin() and it messes up all the timing for my interupts etc.
02:36 AM zap0: i presume because it installs a interupt for serial input.
02:36 AM zap0: i don't need in. just out.
02:36 AM zap0: how might i do UART output only..
02:36 AM zap0: without interupts
02:38 AM nohit: zap0:
02:39 AM zap0: im reading the USART section in the PDF for 328p
02:39 AM zap0: i think i found the 3 lines of C code for sending a byte
02:39 AM zap0: i'm not sure i fully understand the 10~12 lines for the init code
02:40 AM nohit: https://pastebin.com/iFGShC7S
02:40 AM zap0: nohit line 39... you have RXEN set. is that for rx ?
02:41 AM nohit: yes, you can leave that out
02:41 AM nohit: if you want tx only
02:41 AM zap0: and only set TXEN?
02:41 AM nohit: yes
02:41 AM zap0: ok
02:43 AM nohit: that code is for atmega32 so there might be some changes in the register names/bits
02:44 AM nohit: but check your datasheet
02:44 AM zap0: oh. you have XTAL set at 4mil.. i presume i change that to 16mil for my Uno328p
02:44 AM nohit: yeah
02:48 AM zap0: changed most names... this one i can't figure out from the 328p docs. UCSR0C |= (1<<URSEL)|(1<<UCSZ1)|(1<<UCSZ0); it's the line that sets the 8N1 etc..
02:49 AM zap0: there example: /* Set frame format: 8data, 2stop bit */
02:49 AM zap0: UCSR0C = (1<<USBS0)|(3<<UCSZ00);
02:49 AM zap0: i think i want 8N1
02:54 AM nohit: UCSR0C = (1 << UCSZ01) | (1 << UCSZ00);
02:55 AM nohit: i think that gives 8N1
02:57 AM nohit: page 203 http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf
02:57 AM * zap0 reads
02:59 AM nohit: you only need to set the 8, N and 1 are the defaults
02:59 AM nohit: so "UCSR0C = (1 << UCSZ01) | (1 << UCSZ00);" set the 8 data bits
02:59 AM zap0: ok.
03:01 AM zap0: it compiles! thank you.
03:01 AM nohit: np
03:06 AM zap0: output letter 'A' every 5 seconds. and that's what appears on arduino ide serial monitor! it works!.. @9600
03:07 AM nohit: nice
03:07 AM nohit: try the adding the intterupr for rx
03:08 AM nohit: it echoes the char back you send from pc
03:09 AM nohit: even if you dont need it, its good to get it working
03:10 AM zap0: i don't need rx at the moment. i need to figure out how i'm going to send the maximum amount of bytes without adding any wait code.
03:11 AM zap0: from what i see in the docs, i am supposed to wait until the output buffer is finished before i can set a new output byte
03:16 AM nohit: well that alreay built in to the function
03:16 AM nohit: while (!( UCSRA & (1<<UDRE)));
03:18 AM zap0: yeah, i see that code. i've got to figure out how often i can call that and maximize the chance it does no waiting at all
12:44 PM rue_bed: filter profiler, that needs to be my focus today
12:44 PM polprog: bode plotter?
12:45 PM rue_bed: phase and amplitude
12:45 PM rue_bed: I got some more work done on the peak detector board last night
12:46 PM rue_bed: the frequency counter code is working
12:46 PM rue_bed: the idea is you send in 'wild' but stable sine wave, it works out the freq, gain, phase and sends it to serial as csv
12:46 PM polprog: so a bode plotter
12:46 PM rue_bed: yea
12:46 PM polprog: neat
12:47 PM rue_bed: then you step the vco and do again
12:47 PM rue_bed: gonna hand operate the osc for the first few tests
12:47 PM polprog: i need to read up on VCOs
12:47 PM rue_bed: I have a uC controllable vco in the works
12:47 PM polprog: i want a jellybean one
12:47 PM polprog: pure analogue
12:47 PM rue_bed: its trickey cause its a sine wave output osc
12:48 PM polprog: ah
12:48 PM polprog: i was thinking about making a triangle vco
12:48 PM rue_bed: I have 3 designs, two are plausable
12:48 PM polprog: basing on the simple schmitt + cap tri gen
12:48 PM rue_bed: for the plotter you need sine wave, clean
12:48 PM polprog: and putting a current source instead of the resistor
12:48 PM polprog: yeah for that bode plotter you needa sine
12:49 PM rue_bed: I got a lot of 1:10 vco circuits working on the freq gen I did a while back
12:49 PM polprog: aha
12:49 PM polprog: thats a cool project
12:49 PM rue_bed: for the bench ttl clock gen, I ended up using a module
12:49 PM rue_bed: its awesome accurate and stable
12:50 PM rue_bed: still need to put usb control on that one
12:50 PM rue_bed: its been super handy, even tho it just outputs 5v ttl
12:50 PM rue_bed: 0.1hz to 10Mhz
12:51 PM polprog: got a 486 board today
12:51 PM polprog: it has no bios, no CPU and no IO at all
12:51 PM polprog: this is gonna be a hardcore project
12:51 PM polprog: i wonder if i ever make it boot
12:51 PM rue_bed: http://ruemohr.org/%7Eircjunk/projects/freqGen/p1110514.jpg
12:51 PM polprog: its awesome ;)
12:51 PM rue_bed: yea, I totall have a bios
12:51 PM rue_bed: can you burn an rom?
12:52 PM polprog: not yet
12:52 PM polprog: im saving up for a minipro flasher
12:52 PM polprog: it takes a regualr dip eeprom
12:52 PM rue_bed: ok, do you know if its a 27512?
12:52 PM polprog: i think so
12:52 PM polprog: standard bios
12:52 PM polprog: i can tell you how many pins
12:52 PM rue_bed: ok, check, and I should be able to rip you one of mine
12:53 PM polprog: 32
12:53 PM rue_bed: 256 and 512 are the same pin count iirc
12:53 PM polprog: i dont have a way to flash it yet
12:53 PM rue_bed: yea, work on that
12:54 PM rue_bed: eeproms are all 5V programmable
12:54 PM rue_bed: you could go arduino on it
12:54 PM polprog: hmm
12:54 PM rue_bed: pin compatible
12:54 PM polprog: eproms*
12:54 PM polprog: the UV erasable ones
12:54 PM rue_bed: eeprom
12:54 PM rue_bed: pin compatible
12:54 PM polprog: hmm
12:55 PM rue_bed: you can do eprom, but the high voltage stuff is a hurtle
12:55 PM polprog: yeah but the windowed ones are ee or e
12:55 PM rue_bed: I dont recall if the high volage is mixed with one of hte signals or not
12:55 PM rue_bed: window is e
12:55 PM polprog: okay
12:55 PM rue_bed: ee = electrically erasable
12:56 PM polprog: i think i have a flash chip that i could reprogram
12:56 PM polprog: it might fit...
12:56 PM rue_bed: usually strictly 5V to
12:56 PM rue_bed: 512k?
12:57 PM rue_bed: programming the eeproms is annoying cause their sector based and need like 4 transactions per byte, but its doable
12:57 PM polprog: i will probably hack together a serial adapter for that
12:57 PM polprog: hmm but i need io, lots of it
12:57 PM polprog: fuck
12:57 PM rue_bed: m32
12:58 PM polprog: well, avr/stm32 to the rescue
12:58 PM rue_bed: o=r 2650
12:58 PM rue_bed: 2560
12:58 PM polprog: yeah, dump data in over serial and let the avr deal with it
12:58 PM polprog: doesnt have to be fast,
12:58 PM polprog: ill show you a picture of that board, gimme a sec
12:59 PM polprog: https://pbs.twimg.com/media/D67P0miX4AA1x0n.jpg
12:59 PM polprog: already removed the varta killer
12:59 PM rue_bed: burn the cache is gone
12:59 PM polprog: huh?
01:00 PM rue_bed: top right
01:00 PM rue_bed: all those empty narrow sockets
01:00 PM polprog: yeah, i reckon thats memory
01:00 PM rue_bed: cache
01:00 PM polprog: ill have to populate that
01:00 PM polprog: looks like every socketed thing is gone
01:00 PM polprog: fucking cretins
01:00 PM rue_bed: well I did that too when getting rid of a board
01:01 PM polprog: hmm
01:01 PM polprog: will it boot w/o the cache?
01:01 PM rue_bed: technically, everything you need is in the drawrs in my shop
01:01 PM rue_bed: I dont think s
01:01 PM polprog: i need a bigger shop
01:01 PM polprog: well, maybe the sun will work though
01:01 PM rue_bed: i dont recall if thats L1 or L2 cache
01:01 PM polprog: bbl, gotta study phyiscs to get good marks on an exam, to get papers that i know shit
01:01 PM polprog: to get into an uni
01:01 PM polprog: fuck
01:02 PM rue_bed: I'll see if I have that exact board in my stuff, I'll shoot you a pic if I do
01:02 PM polprog: thanks
01:02 PM rue_bed: np
01:02 PM polprog: i know a guy who has a ton of stuff and might have the chips for that
01:03 PM rue_bed: ... gave you the board?...
01:03 PM rue_bed: the cache chips are AWESOME
01:03 PM polprog: nah, i bought it
01:03 PM rue_bed: they are 512k sram, thats enough to make a 3 chip z80 system
01:03 PM polprog: at another guy's
01:03 PM rue_bed: for like $2 or less I hope
01:04 PM polprog: more like $8
01:04 PM rue_bed: good thing the keyboard controller is soldered in..
01:04 PM polprog: lol, true
01:04 PM polprog: shit, i have to study
01:04 PM polprog: catch you later
01:45 PM polprog: hmm
01:48 PM polprog: rue_bed: do you recognize any form of voice comms?
02:14 PM rue_shop1: .... audio!?
02:14 PM polprog: like mumble or whatnot
02:14 PM rue_shop1: why in this day and age would anyone bother with something as high-verhead as realtime audio?
02:15 PM rue_shop1: I much prefer a caching hardware subsystem like irc
02:55 PM nohit: You can do realtime audio on a mcu in this day and age
03:46 PM polprog: https://i.ibb.co/84g9SWW/IMG-20190519-223802.jpg
03:46 PM polprog: maybe ill be able to run this
03:47 PM polprog: 16 segments and 12 grids
03:48 PM rue_mohr: I'd like to see a font for it
03:48 PM polprog: im not sure how to deal with the filaments, i never used a vfd before
03:48 PM rue_mohr: dude
03:48 PM polprog: i might make it a serial terminal
03:48 PM rue_mohr: I done this 3 times since I been on twitter
03:48 PM polprog: i know they need to be heated up
03:48 PM polprog: i know
03:48 PM rue_mohr: I can help you
03:48 PM polprog: thats why i posted it here
03:48 PM rue_mohr: do you have any of the origional electronics?
03:49 PM polprog: yes
03:49 PM polprog: i just desoldered it
03:49 PM rue_mohr: can you measure the origional filament voltage?
03:49 PM polprog: cause i want to make my own control circuitry
03:49 PM polprog: the board says -30V
03:49 PM polprog: sec
03:49 PM rue_mohr: it might be about 3 or 6V
03:49 PM polprog: wait a sec
03:49 PM rue_mohr: it might be as low as 2
03:50 PM polprog: no, its a small board taken out of a parts bin
03:50 PM rue_mohr: ok
03:50 PM rue_mohr: fair enough
03:50 PM rue_mohr: have a variable voltage power supply?
03:50 PM polprog: no dice, its got two pins labeled as FL1 and FL2
03:50 PM polprog: yeah i do
03:50 PM rue_mohr: ok
03:51 PM polprog: if anything, ill do it tomorrow
03:51 PM rue_mohr: in a dark room CAREFULLY, dial the votlage up from zero untill you see a faint orangle glow
03:51 PM polprog: mm
03:51 PM rue_mohr: use a bit less than that
03:51 PM rue_mohr: keep it under 6V
03:51 PM rue_mohr: for sure
03:52 PM polprog: okay
03:52 PM polprog: ill try it now
03:52 PM rue_mohr: uuuuber carefull
03:52 PM polprog: if anything i can get another one for next to nothing
03:52 PM polprog: ;)
03:52 PM rue_mohr: just a tiny faint glow
03:54 PM polprog: i got a barely visible glow at 2.6
03:55 PM rue_mohr: ok, so 2V should do!
03:55 PM polprog: okay
03:55 PM rue_mohr: note that!
03:55 PM polprog: i think this will make a good topic for an article
03:55 PM polprog: ;)
03:55 PM rue_mohr: for each grid and anode, you will need a high voltage channel from a ULN2003 or ULN2803
03:55 PM rue_mohr: yep
03:55 PM polprog: ok
03:56 PM polprog: i know how it works
03:56 PM rue_mohr: you can feed those via a 74hc595
03:56 PM rue_mohr: to cut down on io pins
03:56 PM rue_mohr: you also need a 24V dc supply
03:56 PM rue_mohr: and we should have an AC supply that we can bias up by 5V
03:57 PM polprog: grid and segment use both positive voltage?
03:57 PM rue_mohr: no
03:57 PM rue_mohr: relative, grid goes + and -
03:57 PM polprog: okay
03:57 PM rue_mohr: relative to the filament
03:57 PM polprog: how negative?
03:57 PM rue_mohr: so you bias the filament at +5V, and then driving between 0 and 24V is really -5 to 19V
03:58 PM polprog: ok
03:58 PM polprog: hmmm, i should make a power supply for that
03:58 PM rue_mohr: do you have one of those chineese boost modules?
03:58 PM polprog: yeah, but id rather not use it
03:58 PM polprog: in the final thing
03:58 PM rue_mohr: ok
03:58 PM polprog: i can use it in testing
03:58 PM rue_mohr: did you see the circuit I did for the filament on twitter?
03:58 PM polprog: no
03:59 PM rue_mohr: well
03:59 PM polprog: i wonderif i could fit everything as low as 12v single ended supply
03:59 PM rue_mohr: its definitly lost in the dogpile of twitter
03:59 PM polprog: yeah, that sucks
03:59 PM rue_mohr: oh I can totally help you make a votlage doubler
03:59 PM rue_mohr: thats easy
03:59 PM rue_mohr: 12V->24V
03:59 PM rue_mohr: I love that one
03:59 PM polprog: hmm, makes sense
03:59 PM polprog: thats easy yeah
04:00 PM polprog: i think i know how to make one up
04:00 PM rue_mohr: you need a dual-coil EMI filter from a power supply, a 74HC14, and two driver transistors
04:00 PM polprog: and thats not high current, its just to attract some electrons to hit the right place
04:00 PM rue_mohr: no, its like maybe 20mA
04:00 PM polprog: yeah, not much
04:00 PM rue_mohr: you actually dissipate most of it in the pullup resistors
04:01 PM rue_mohr: I used 2k, but from what I can tell, 10k is fine
04:01 PM rue_mohr: "10k is ok... no... no dont type that..."
04:01 PM polprog: this one is nice, its a 14 segment display
04:01 PM rue_mohr: yea
04:01 PM polprog: and some silly sumbols
04:01 PM rue_mohr: love it
04:01 PM polprog: :D
04:01 PM rue_mohr: its fun when you get it working to map all the segments out
04:02 PM polprog: i was hoping i could do it now
04:02 PM polprog: i have a nice PSU that has +5, +15 -15 rails
04:03 PM polprog: well, "now"
04:03 PM rue_mohr: hmm, awkward
04:03 PM polprog: i mean without making up a whole lineup of supplies
04:03 PM polprog: i have to go
04:03 PM polprog: shower and sleep
04:03 PM rue_mohr: you could use a 1.5V battery for the filement maybe
04:03 PM polprog: bloody exam tomorrow
04:03 PM polprog: thanks a lot!
04:03 PM polprog: ill make up a neat stabilized driver for the filament
04:03 PM polprog: just a couple diodes
04:04 PM polprog: and an opamp + fet
04:04 PM rue_mohr: and if you hold one end of the filament at 5V, and then tie a grid and an anode at +15V, you might get something
04:04 PM rue_mohr: polprog,
04:04 PM polprog: wait
04:04 PM polprog: holdup filament at +5, and grid + seg at +15?
04:04 PM rue_mohr: how about two transistors, 2 resistors, and a base driver transformer from a computer power supply?
04:05 PM rue_mohr: negitive is off
04:05 PM polprog: mmkay
04:05 PM polprog: gimme a sec
04:05 PM rue_mohr: just carefull, only 2V across the filament
04:05 PM rue_mohr: but all biased up (for the computer version anyhow) by 5V
04:05 PM rue_mohr: I suppose if you do it mantually, its a diode
04:07 PM polprog: ah te filament needs to emit electrons right
04:07 PM polprog: ok, so 2v from lab psu
04:07 PM polprog: fuck it
04:07 PM rue_mohr: yea, have a 1.5V battery to isolate the filament supply?
04:07 PM polprog: i have to go
04:07 PM rue_mohr: ah well, touch base alter
04:07 PM polprog: ill do it tomorrow :/
04:07 PM rue_mohr: later
04:07 PM polprog: i have to go, se you on the flip side
04:07 PM rue_mohr: I can try to collect vfd stuff
04:08 PM rue_mohr: but first, robot stuff!
04:41 PM polprog: ill go get some more next week or maybe sooner
04:41 PM polprog: https://i.ibb.co/T8QTkZd/IMG-20190519-230638.jpg
04:41 PM polprog: psus
04:42 PM polprog: https://i.ibb.co/z4Kp2qr/IMG-20190519-233518.jpg vfd seems to be green/blue + red
04:42 PM rue_mohr: mmm rigol
04:53 PM polprog: you havent seen my bench?
04:53 PM polprog: phones are a curse. i should be sleeping now
05:02 PM polprog: i think i have an idea for the filament psu
05:06 PM polprog: rue_mohr: do you think the board could run w/o cache?
05:07 PM polprog: or do i need at least 1 chip there
05:17 PM davor_ is now known as davor
05:28 PM tpw_rules: polprog: what board
05:42 PM polprog: tpw_rules: https://twitter.com/polprogpl/status/1130060947043827713?s=19
05:43 PM tpw_rules: i think things that old can be configured to turn off cache in bios
05:43 PM tpw_rules: or with a jumper
05:44 PM polprog: hmm
05:47 PM polprog: goodnight
09:55 PM [1]MrMobius is now known as MrMobius
11:43 PM day__ is now known as day