#avr Logs

Jun 28 2022

#avr Calendar

02:58 AM specing_ is now known as specing
07:35 AM josuah: rue_mohr: it went online on the Opus 5, among other articles
07:35 AM josuah: - https://gopherproxy.net/bitreich.org/1/tgtimes/
07:35 AM josuah: - gopher://bitreich.org/1/tgtimes/
09:00 AM rue_mohr: :)
09:21 AM rue_mohr: heh, I thought you might wrap it a bit!
09:23 AM josuah: rue_mohr: I wanted not to editorialise too much, which I already did lightly
09:24 AM rue_mohr: :)
09:25 AM rue_mohr: I probably had lots of speeling errors
09:26 AM Cracki: Definition of speel . verb (used with or without object) Scot. and North England. to climb; ascend; mount.
09:30 AM josuah: broken strings either way
09:30 AM josuah: rue_mohr: maybe I introduced some too
01:36 PM Tigzee: I need help. This is the first time I have used a crystal in a long time (like 20yrs) instead of the internal RC oscillator. No matter what I do, I keep getting 8mhz timing using a digital oscilliscope watching pins triggering from on to off.
01:39 PM Tigzee: The crystal says 24mhz, and I have used 15nf caps. I have also tried makig a secodn one using 24mhz crystal and 10nf caps. These are using attiny44a's with fuse bits: avrdude -p t44 -c usbasp -U lfuse:w:0xff:m -U hfuse:w:0xd7:m -U efuse:w:0xfe:m
01:39 PM Tigzee: *If I disconnect the crystal, they stop working as expected
01:40 PM Tigzee: *they stop working (as expected as no more clock source)
01:40 PM Tigzee: They are running on 5v
01:41 PM Tigzee: I know 24mhz is overclocking, but I feel that should still be obtainable. and its needed for my timings
01:43 PM cehteh: 15nf caps?
01:43 PM cehteh: has the t44 fallback to internal osc when the external doesnt work? then that happens :D
01:44 PM Tigzee: I meant picoFarad
01:44 PM cehteh: usually these capacitance should be in the 15pF range (read datasheet!) .. and that includes the capacitance of the pins and traces which already has some effect there
01:45 PM cehteh: dunno the t44 but when its 8mhz then its likely still running on internal osc
01:46 PM Tigzee: the caps look like: https://rb.gy/hxn3xm
01:46 PM cehteh: tiny45 (25 85) .. can do 16Mhz from internal osc .. plus OSCCAL overclocking so prolly 24mhz
01:47 PM cehteh: mhm t44 looks like not having a pll
01:47 PM Tigzee: If I disconnect the crystal, the chips are unresponsive. So I don't think they fall back
01:47 PM cehteh: are you sure its 8mhz? not 3mhz?
01:47 PM cehteh: clkdiv/8 still active?
01:49 PM Tigzee: Im using a digital oscilliscope that is showing the off period to be 124.809ns (8mhz)
01:49 PM cehteh: scope on what? toggling a pin or crystals pins?
01:49 PM Tigzee: Im doing the program in assembly, and its literally, turn pin off, turn pin on
01:50 PM cehteh: toggle in hardware or with xor?
01:51 PM Tigzee: out PORTA, 0b00000000
01:51 PM Tigzee: out PORTA, 0b11111111
01:51 PM cehteh: out PINA, 0b11111111
01:51 PM cehteh: try^
01:52 PM cehteh: well thats this 2 instructions plus the loop so you divide your 24mhz already by 3 or so
01:52 PM cehteh: so having 8mhz on the pin from 24mhz clock sounds about right
01:53 PM Tigzee: I do that twice before the loop (rjmp) so the off part should only be 1cycle (its on during the loop)
01:55 PM Tigzee: I have it, so its off for 1 cycle, then on for 6 cycles. Then I do this again for another pin then loop (the loop cycles is accounted for)
01:55 PM cehteh: well dunno then
01:56 PM Tigzee: I erad teh newer attiny's fall back to internal oscillator until it does a reset, but I haven't seen that in the attiny44a datasheet
01:57 PM Tigzee: and once the fuse bits are set, even the programmer can't communicate with the tiny44a without a crystal hooked up
01:58 PM Tigzee: and the pattern on the oscilliscope is stable and exactly what I want to see (but just wrong timing)
02:06 PM Tigzee: https://pasteboard.co/dGOaJme9Eq1M.png
02:07 PM Tigzee: ^That sums up my problem nicely for someone to help
02:14 PM Tigzee: Verifying the fuses: https://pasteboard.co/bnw5EwUINlmY.png
02:33 PM cehteh: did you try LOOP: out PINA, 0x03 rjmp LOOP
02:37 PM Tigzee: I think PINA is defined by 0b0000001?
02:37 PM Tigzee: let me go check
02:38 PM Tigzee: Its not, 1 sec
02:41 PM Tigzee: datasheet says PINA is for reading the values for input
02:41 PM Tigzee: I will try it, 1 sec
02:45 PM Tigzee: The output isn't acting correctly anymore using "PINA"
02:48 PM Tigzee: https://pasteboard.co/b2zOqZRXVSbX.png
02:48 PM Tigzee: at no point should D0 or D1 be both on
02:54 PM cehteh: writing to pina toggles the set bits in hardware, 1 instruction for toggle
02:55 PM cehteh: thats exactly what you see there 24mhz, all fine .. the 2 low states are becasuse of the jmp
02:56 PM Tigzee: D0 is PINA0. D1 is PINA1. D2 is clockout (set in fuse)
02:57 PM cehteh: ah
02:57 PM cehteh: did you do the code i shown above?
02:57 PM Tigzee: I will in 1 second.
02:57 PM cehteh: that and only that, interrupts disabled
02:58 PM Tigzee: interrupts are never enabled, but I can specify them to be disabled
02:58 PM specing_ is now known as specing
02:58 PM cehteh: with that code your D1 & D2 should be in sync and look like the D2 below (or inverted)
02:59 PM cehteh: well and when D2 is clockout then its really for some reason 8mhz, but i have no idea why
03:00 PM cehteh: you can check if its the internal osc by changing OSCCAL .. on external it would have no effect
03:00 PM cehteh: but 8mhz pretty much looks like internal osc
03:00 PM cehteh: check fuses again
03:04 PM Tigzee: Heres the output avrdude: safemode: Fuses OK (E:FE, H:D7, L:BF)
03:05 PM Tigzee: we need more than what you gave me. it will just set pina to the same thing every loop
03:06 PM cehteh: do it
03:06 PM Tigzee: I can see there is something wrong with D2. With the clock being 24mhz and the oscilliscope being 24mhz, It should be landing on the same part of the wave everytime (loking like a straight line)
03:06 PM cehteh: as i saied writing to pina *TOGGLES* the set bits
03:07 PM cehteh: at least on many modern avr's dunno if t44 does that, but iirc all but the oldest have that feature
03:08 PM cehteh: of course you could also use pwm to toggle the output as fast as possible (would be 12mhz then iirc)
03:09 PM cehteh: you showing pulseview .. do you have an actual oscilloscope?
03:10 PM cehteh: when you sample at 24mhz you can only watch a 12mhz signal at best, claude shannon is greeting
03:11 PM Tigzee: cehteh: https://pasteboard.co/2dsk3BLZQl83.png
03:14 PM cehteh: looks like the t44 cant toggle in hardware?
03:15 PM cehteh: well dunno, i dont want to read the datasheet, and afk now, someone else may know
03:15 PM Tigzee: I don't think its programming logic. Its something going on with the clock source
03:16 PM Tigzee: am I overlooking something like a hidden fuse bit? Do I need a different value cap for 24mhz? I dunno
03:46 PM Cracki: >overclocking
03:47 PM Cracki: some dude I used to know claims avrs can be pushed to 200% clock but idk
03:52 PM Tigzee: Theres lots of claims of it, and what parts fail at what frequencies. All making 24mhz look like childs play
03:53 PM Tigzee: But I can't find anywahere what they specificallyuse to get it. I know the higher clocks just use a clock source instead of crystals
11:47 PM Tigzee: Update: read a lot into full swing which is no longer an option. crystals have diffrent harmonics and how capacitors filter them out...losing all hope, I Made a 3rd setup without xtal capacitors and it seems to work with the crystal literally place with its leads "hanging" on the pins.
11:48 PM Tigzee: I will make it a better connection, but at least I have my timer now
11:49 PM Tigzee: I also expected a lot of error with that connection, but it shows none. so I have high hopes
11:50 PM Tigzee: I guess I can unsolder the other caps off the units to verify