#avr Logs

Aug 25 2020

#avr Calendar

12:01 AM dgriffi: so, I have a UART setup working on an atmega164 using https://www.nongnu.org/avr-libc/user-manual/group__stdiodemo.html
12:07 AM dgriffi: now I'm trying to figure out how to interrupt execution when something comes in through the UART and the program is doing something else.
12:07 AM dgriffi: I tried ISR (USART0_RX_vect) but it doesn't seem to work.
12:07 AM markasoftware: dgriffi: did you enable interrupts globally, ie, sei() ?
12:07 AM dgriffi: markasoftware: yes. the most I've gotten with this is that when the uart routines are back in control, it looks like the return key is being held down and then sometimes the AVR resets.
12:10 AM dgriffi: so, I guess what I want is that after a line is entered, any further bytes received should interrupt. instead, they seem to get backed up and stuff barfs out when the prompt comes back.
12:34 AM markasoftware: what do you do in the interrupt handler?
12:39 AM dgriffi: set a global volatile variable. then check that repeatedly when the AVR isn't taking rs232 input
12:39 AM dgriffi: I'm almost done cutting down what I'm doing to a minimal demo program.
12:49 AM dgriffi: markasoftware: what do you make of this? http://paste.debian.net/1161098/
01:16 AM markasoftware: why do you use a delay function that does _delay_ms(1) in a loop rather than just calling _delay_ms(n)
01:22 AM dgriffi: because in my actual code, I need to delay a varying amount of time
01:23 AM dgriffi: there are several variables set with something like "/set interchar 45" to make the inter-character delay 45 ms.
01:23 AM dgriffi: in other words, I cannot have them set at compile time
11:08 AM polprog: dgriffi: i dont see a uart interrupt enable in your uart init
07:18 PM luxemboy1 is now known as luxemboye
11:46 PM day_ is now known as day