You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
i want to use a timeout interrupt.
on my interrupt loop i want to change the TCB0.CNT value but not considered
register TCB0.CNT stay on the first value, impossible to change it on the interrupt loop.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
i want to use a timeout interrupt.
on my interrupt loop i want to change the TCB0.CNT value but not considered
register TCB0.CNT stay on the first value, impossible to change it on the interrupt loop.
my code below :
Charles
ISR(TCB0_INT_vect)
{
Servo_Ports_LOW;//all servo ports low
//code for servo.
cur_chan_numb++;//next servo
if(cur_chan_numb < chanel_number){
//Serial.println(ppm_data[0]);
total_servo_time +=ppm_data[cur_chan_numb]*scale;
TCB0.CNT=ppm_data[cur_chan_numb]*scale;
//Serial.print("LOW");
void setup() {
/*configure timer TCB1 for PWM */
cli();
TCB0.CTRLA= TCB_ENABLE_bm;
TCB0.CNT=0;
TCB0.CTRLB=0; // periodic interrupt mode
//TCB0.CTRLB = TCB_CNTMODE_FRQPW_gc;
//TCB1.CTRLB = TCB_CNTMODE_TIMEOUT_gc;
TCB0.CCMP = 50*2; //
TCB0.INTCTRL=TCB_CAPT_bm;
TCB0.CTRLA= TCB_CLKSEL_CLKDIV1_gc | TCB_ENABLE_bm;
sei();
Beta Was this translation helpful? Give feedback.
All reactions