Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4922

Attiny85 Manchester Encoding Timing Problem

$
0
0
Hello, I've been having trouble getting this little timer routine to work correctly. I started out with a little program that switches the output of a pin every 240µs which turned out to work as expected:

Code (C):
  1.  
  2. // This program switches the output of PB3 every 240µs.
  3.  
  4. #include <avr/interrupt.h>
  5. #include <avr/io.h>
  6.  
  7. ISR(TIMER0_COMPA_vect)
  8. {
  9.         PORTB ^= _BV(PB3);
  10. }
  11.  
  12. int main()
  13. {
  14.         DDRB |= _BV(PB3);
  15.         TCCR0A = _BV(WGM01);
  16.         TCCR0B = _BV(CS00);
  17.         TIMSK =...
Attiny85 Manchester Encoding Timing Problem

Viewing all articles
Browse latest Browse all 4922

Trending Articles