#avr Logs

Sep 14 2019

#avr Calendar

12:22 AM ThatDamnRanga: learningc, mostly, moved to other technologies probably
12:30 AM day__ is now known as day
01:30 AM day__ is now known as day
01:33 AM rue_bed: irc has been generally dieing
01:34 AM rue_bed: most of the nicks in here are stand-in bots for people who want to "follow" the channel, but never actually look at the content
01:35 AM rue_bed: as with most channels
02:00 AM day__ is now known as day
02:33 AM aborazmeh_ is now known as aborazmeh
02:42 AM day__ is now known as day
03:12 AM day__ is now known as day
04:07 AM day__ is now known as day
04:51 AM day__ is now known as day
06:05 AM Smidge204: This channel is still active enough that it's a good resource for discussion/questions. The lack of a large active user base just cuts down on the offtopic chitchat
06:35 AM Emil: Consider joining #avrs
07:12 AM vmt: i don't think it serves any purpose to have two channels
07:30 AM cehteh: it serves Emil's ego
07:40 AM vmt: yeah good catch, i overlooked that
07:41 AM vmt: especially considering how the real premise why Emil created that channel isn't exactly valid anymore. rue hasn't been rogue kicking people off for a long time
07:42 AM vmt: but this is meta, it's best practiced by housewives...
11:51 AM juli: hi may i ask here a question about an attiny timer interrupt? or is it the wrong place?
11:52 AM cehteh: right place
11:52 AM cehteh: but i am almost out, be patient waitong for answers
11:53 AM juli: ok
11:54 AM juli: i wanted an interrupt to be triggered after x clock ticks. I did set TCNT1 to 0 and enabled "compare match" (TIMER1_COMPA_vect) with OCR1A=40.
11:55 AM juli: but the interrupt triggered already after 4 ticks or so
11:55 AM juli: how can that be?
11:56 AM cehteh: wrong order of initialization? interrupt was already pending/set, wrong prescaler etc
11:57 AM juli: well i may show u the code, but i think nothing of that is the case
11:58 AM cehteh: hint: you clear a pending interrupt flag bywriting 1 to it
11:58 AM cehteh: put it in a pastebin but i am almost out here, up to go
11:58 AM cehteh: its very likely that you initialize something in the wrong order
11:59 AM cehteh: also: when you can dont touch TCNT, start timer once, keep it running (yes that wont work always) but often thats the better way
12:00 PM cehteh: settung up and starting timers has some overhead and inprecision as well
12:00 PM juli: here is the code: https://dpaste.de/9jBn
12:00 PM cehteh: OCR1A=TCNT1+40; ---
12:01 PM juli: good idea :)
12:01 PM juli: so u should not change the TCNT if the timer is running?
12:02 PM juli: *i should not
12:05 PM cehteh: ideally not .. and i am out .. bbl
12:06 PM juli: cu thx
12:19 PM juli: sorry timed out, but my problem is not fixed yet ...
12:20 PM juli: i did what cehteh suggested, but still the interrupt is called nearly immediately after the interrupt was enabled
12:24 PM juli: the wierd thing is, i disable the interrupt in the ISR, but its still called 2x (it should be disabled at the first time and not called at the second). I see this using my logic analyzer
12:52 PM juli: here is a new version of my code: https://dpaste.de/Qa01
12:52 PM juli: now the problem is that the interrupt is called much to late
12:53 PM juli: normaly it should be called after x*40 seconds but it is called after around x*120 seconds
12:54 PM juli: * i mean x*60 not 120
12:54 PM juli: is somebody here who can help now?
01:44 PM juli: ok i solved the problem myself
01:45 PM juli: it was one mistake of me, i missed one "not" (!) in an if
01:45 PM juli: clause
10:06 PM [1]MrMobius is now known as MrMobius
11:39 PM day__ is now known as day