#avr Logs

Sep 11 2021

#avr Calendar

02:30 PM specing_ is now known as specing
04:20 PM Smashcat: Hi, anyone know if changing pin settings on PORTC on an ATMega328pb via a timer interrupt while an ADC conversion is happening is supposed to cause problems with the ADC?
04:21 PM Smashcat: (obviously not changing the pins the ADMUX is connected to)
04:22 PM LeoNerd: I imagine it isn't *supposed* to, but it's possible there could be silicon bugs
04:22 PM LeoNerd: Are you ADMUX'ing from a pin on PORTC?
04:23 PM Smashcat: Yep, I'm reading from C4 and C5, but using other pins to multiplex an LED array via an interrupt
04:25 PM Smashcat: Hmm, seems like it's the timer interrupt itself that's preventing the ADC from reading (it always returns 255 - set to 8 bit reads). I disabled the other pins on PORTC from being used to multiplex. Think I need to come up with a different solution :)
04:39 PM Smashcat: Ahhhh, found the issue. I'd left the code reading from ADCL from when I was reading a 10bit value. After setting ADLAR, I needed to change it to ADCH - doh!