I'm using timer2 which supports analog writes on pin 11 which is suppose to be MOSI for SPI. This seems to interfere with a HX8357 TFT (adafruit 2050). Its just the gray 'startup' screen. I notice that the uno has a ICSP header, would moving to the correct pin on that fix the problem? Or is it, as i suspect, just an alternative wiring spot.
I choose to use timer 2 because I didn't want to give up micro() and milli() cmds, or servo functionality. Does anybody know if software servo can run without timer1? It would be easy enough to switch timers.
If it matters I'm getting an external interrupt, which zeros timer 2, and sets a compare value to execute the isr at the specified count.
void heater_pwr()
{
TCNT2 = 0; //Set the timer count to zero
OCR2A = pwr;
}
Or is it, as i suspect, just an alternative wiring spot.
It is. Both pins are connected on the board.
If it matters I'm getting an external interrupt, which zeros timer 2, and sets a compare value to execute the isr at the specified count.
You should have posted complete code, as without it my sentences are pure speculation.
If you're just using timer 2 to generate the interrupt and no PWM signal, it shouldn't interfere with the MOSI signal of the hardware SPI.
As you're relying on direct register manipulation for the timer functionality I would omit the digitalWrite() calls and use the much faster PORT manipulations.
Ok, I'll poke at it more. See what happens. You're right, but I'm not use to port designations.
I'm firing a triac with a single ~ 64 micro second output (whats left of one count) on pin 4. I started doing that on an interrupt basis because of the length of time to write with spi to the tft, or LCD on I2C, was causing missed zero crossing interrupts, and therefore triac firings.
I'm firing a triac with a single ~ 64 micro second output (whats left of one count) on pin 4. I started doing that on an interrupt basis because of the length of time to write with spi to the tft, or LCD on I2C, was causing missed zero crossing interrupts, and therefore triac firings.
I don't know how that's related. I might be time to post complete code and a wiring diagram.
Ok, tore it all the way down, built it back up and found a bit of the old triac driver code that was still in the code. works fine now with pins 9 & 10 moved to 3&4.