Hello.
I just made a pulse counter for hardware by arduino one. But I need to do with the arduino due. Because the account is greater than 70000 pulses im in need to do so with arduino due. I found very little information about this
I even read 36. Timer Counter (TC) SAM3X data sheet, but not if you go down the right path.
could you help me
unsigned long pulses;
void setup() {
Serial.begin(9600);
TC_Configure ( TC0, 0, TC_CMR_TCCLKS_XC2| TC_CMR_ETRGEDG_FALLING | TC_CMR_ABETRG | TC_CMR_LDRA_FALLING ); //tratar deactivar la escritura con WAVE
TC0->TC_CHANNEL[0].TC_RA;
}
void loop() {
const uint32_t pulses = TC_ReadCV ( TC2, 2 );
//Serial.print( TC_ReadCV(TC0,0));
Serial.print( REG_TC0_CV0, DEC);
Serial.print(" ");
Serial.println(pulses);
delay(10);
}
counte_of_pulses_DUE.ino (640 Bytes)