Skip to main content
Bumped by Community user
Bumped by Community user
edited title
Link
dda
  • 1.6k
  • 1
  • 12
  • 18

Does SoftwareSerial use timer hardware timer?

Bumped by Community user
deleted 6 characters in body; edited title
Source Link
dda
  • 1.6k
  • 1
  • 12
  • 18

does software serial Does SoftwareSerial use timer hardware?

I'm asking this because I'm using a timer to generate a 38KHZ signal to drive an IR diode, and I also need to use software serialSoftwareSerial to talk to an HC-12 radio using serial communication.

The code I'm using was written by Nick Gammon and is here:

//Setup Conter/overflow to create 38KHZ drive for IR38KHZ
//38khz, no interrupts
#define IR_CLOCK_RATE 38000L
// toggle on compare, clk/1
TCCR2A = _BV(WGM21) | _BV(COM2A0);
TCCR2B = _BV(CS20);
// 38kHz carrier/timer
OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1);
pinMode(IR38KHZ, OUTPUT);

I'm not quite up-to-date on the timer use on an Arduino (I'm using a NANONano), plus I've no idea what the software serialSoftwareSerial library uses.

does software serial use timer hardware

I'm asking this because I'm using a timer to generate a 38KHZ signal to drive an IR diode, and I also need to use software serial to talk to an HC-12 radio using serial communication.

The code I'm using was written by Nick Gammon and is here:

//Setup Conter/overflow to create 38KHZ drive for IR38KHZ
//38khz, no interrupts
#define IR_CLOCK_RATE 38000L
// toggle on compare, clk/1
TCCR2A = _BV(WGM21) | _BV(COM2A0);
TCCR2B = _BV(CS20);
// 38kHz carrier/timer
OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1);
pinMode(IR38KHZ, OUTPUT);

I'm not quite up-to-date on the timer use on an Arduino (I'm using a NANO), plus I've no idea what the software serial library uses.

Does SoftwareSerial use timer hardware?

I'm asking this because I'm using a timer to generate a 38KHZ signal to drive an IR diode, and I also need to use SoftwareSerial to talk to an HC-12 radio using serial communication.

The code I'm using was written by Nick Gammon and is here:

//Setup Conter/overflow to create 38KHZ drive for IR38KHZ
//38khz, no interrupts
#define IR_CLOCK_RATE 38000L
// toggle on compare, clk/1
TCCR2A = _BV(WGM21) | _BV(COM2A0);
TCCR2B = _BV(CS20);
// 38kHz carrier/timer
OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1);
pinMode(IR38KHZ, OUTPUT);

I'm not quite up-to-date on the timer use on an Arduino (I'm using a Nano), plus I've no idea what the SoftwareSerial library uses.

added 38 characters in body
Source Link
Majenko
  • 105.9k
  • 5
  • 82
  • 139

I'm asking this because I'm using a timer to generate a 38KHZ signal to drive an IR diode, and I also need to use software serial to talk to an HC-12 radio using serial communication.

The code I'm using was written by Nick Gammon and is here:

//Setup Conter/overflow to create 38KHZ drive for IR38KHZ //38khz, no interrupts #define IR_CLOCK_RATE 38000L // toggle on compare, clk/1 TCCR2A = _BV(WGM21) | _BV(COM2A0); TCCR2B = _BV(CS20); // 38kHz carrier/timer OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1); pinMode(IR38KHZ, OUTPUT);

//Setup Conter/overflow to create 38KHZ drive for IR38KHZ
//38khz, no interrupts
#define IR_CLOCK_RATE 38000L
// toggle on compare, clk/1
TCCR2A = _BV(WGM21) | _BV(COM2A0);
TCCR2B = _BV(CS20);
// 38kHz carrier/timer
OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1);
pinMode(IR38KHZ, OUTPUT);

I'm not quite up-to-date on the timer use on an Arduino (I'm using a NANO), plus I've no idea what the software serial library uses.

I'm asking this because I'm using a timer to generate a 38KHZ signal to drive an IR diode, and I also need to use software serial to talk to an HC-12 radio using serial communication.

The code I'm using was written by Nick Gammon and is here:

//Setup Conter/overflow to create 38KHZ drive for IR38KHZ //38khz, no interrupts #define IR_CLOCK_RATE 38000L // toggle on compare, clk/1 TCCR2A = _BV(WGM21) | _BV(COM2A0); TCCR2B = _BV(CS20); // 38kHz carrier/timer OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1); pinMode(IR38KHZ, OUTPUT);

I'm not quite up-to-date on the timer use on an Arduino (I'm using a NANO), plus I've no idea what the software serial library uses.

I'm asking this because I'm using a timer to generate a 38KHZ signal to drive an IR diode, and I also need to use software serial to talk to an HC-12 radio using serial communication.

The code I'm using was written by Nick Gammon and is here:

//Setup Conter/overflow to create 38KHZ drive for IR38KHZ
//38khz, no interrupts
#define IR_CLOCK_RATE 38000L
// toggle on compare, clk/1
TCCR2A = _BV(WGM21) | _BV(COM2A0);
TCCR2B = _BV(CS20);
// 38kHz carrier/timer
OCR2A = (F_CPU/(IR_CLOCK_RATE*2L)-1);
pinMode(IR38KHZ, OUTPUT);

I'm not quite up-to-date on the timer use on an Arduino (I'm using a NANO), plus I've no idea what the software serial library uses.

Source Link
user29356
  • 89
  • 1
  • 3
  • 9
Loading