#avr Logs

Aug 31 2019

#avr Calendar

12:06 AM day__ is now known as day
07:50 AM Smidge204: I wrote the interrupt routine, and it's running *all the time* now... over and over
07:51 AM cehteh: sounds wrong
07:51 AM Smidge204: Yeah maybe :)
07:52 AM cehteh: you have one of the new -0 or -1 series?
07:52 AM Smidge204: attiny814 not sure the exact series
07:52 AM Smidge204: one sec
07:53 AM cehteh: iirc someone saied you have to clear the interrupt flag manually there, i dunno the old ones clear it on isr
07:53 AM cehteh: or is it a level triggered interrupt?
07:54 AM Smidge204: I'm clearing the INT flags though it's not the very first thing I do... I'll try that
07:54 AM Smidge204: It's a BOTHEDGES trigger since I need it to wake up from power down mode
07:55 AM cehteh: and dont forget at least for what i know from the old ones: clearing an isr flag means writing 1 to it
07:55 AM Smidge204: Yup. I'm writing 0xFF to the whole register
07:56 AM cehteh: dunno if thats ok .. what other flages are ther?
07:58 AM Smidge204: I'm looking to see if there's a global flag
07:59 AM cehteh: nah you need to clear the specific flag only
08:00 AM Smidge204: Right. I should just need to clear the interrupt flags or the bit(s) that triggered the interrupt by writing a 1 to it
08:00 AM Smidge204: LDI R19, 0xFF / OUT VPORTA_INTFLAGS, R19
08:00 AM Smidge204: ...should do it
08:00 AM cehteh: well, see datasheet, on the traditional AVR's its cleared automatically afaik (hey i do C only and it works)
08:01 AM Smidge204: "Interrupt flags are not automatically cleared after the interrupt is executed. The respective INTFLAGS register descriptions provide information on how to clear specific flags"
08:01 AM cehteh: but there could be other reasons that your isr is constantly fireing, accidentally left some config for level triggerd for example
08:02 AM cehteh: ok thats what i normally expect, but i know from other chips that sometimes the user is responsible for clearing interrupt flags
08:03 AM cehteh: well ... make a minimal text with only one pin configured to be watched
08:03 AM cehteh: test
08:03 AM Smidge204: I think I got it.
08:03 AM Smidge204: As usual, I did a dumb and configured the wrong pin
08:04 AM cehteh: thats assembler for you :D
08:06 AM Smidge204: No brakes on this train!
08:06 AM Smidge204: Now I just need to test w LDI R19, 0xFF
08:06 AM Smidge204: OUT VPORTA_INTFLAGS, R19
08:06 AM Smidge204: whoop sorry
08:22 AM vmt: are you the guy who was headstrong about writing only asm?
08:24 AM Smidge204: I dunno about "headstrong" but it's certainly my personal preference
08:29 AM nohit: mark4 was the guy who still uses assembly professionally
08:30 AM nohit: but he hasnt been around for a while
08:34 AM cehteh: i order those redpolls next week and then will try to get rust running on them
08:36 AM cehteh: would be cool when that works, learning rust on the way, add some smore reliablility, but i dunno yet how well rust behaves on a µC because as far i know it needs an allocator
08:52 AM vmt: church of eso... i mean rust, sacrifice some virgins to daddy dagon
08:53 AM vmt: nohit: a long time ago there was a guy named mark-something here, who had some lawsuits going on, which according to him would net him millions
08:53 AM vmt: i wonder if he's the same guy. could be.
03:28 PM captain_morgan7 is now known as captain_morgan