Add something stuff, not work
This commit is contained in:
parent
14c09f63a9
commit
9cf37461d2
@ -36,25 +36,30 @@ void PORT_init(){
|
||||
// TCB3.CTRLA = TCB_CLKSEL_DIV1_gc /* CLK_PER */|1<< TCB_ENABLE_bp /* Enable: enabled */|0<< TCB_RUNSTDBY_bp /* Run Standby: disabled */|0<< TCB_SYNCUPD_bp /* Synchronize Update: disabled */|0<< TCB_CASCADE_bp;/* Cascade Two Timer/Counters: disabled */
|
||||
|
||||
//ASYNC disabled; CCMPINIT disabled; CCMPEN disabled; CNTMODE FRQPW;
|
||||
TCB2.CTRLB = 0x15;
|
||||
TCB3.CTRLB = 0x15;
|
||||
|
||||
//DBGRUN disabled;
|
||||
TCB2.DBGCTRL = 0x00;
|
||||
TCB3.DBGCTRL = 0x00;
|
||||
|
||||
//FILTER disabled; EDGE disabled; CAPTEI enabled;
|
||||
TCB2.EVCTRL = 0x01;
|
||||
TCB3.EVCTRL = 0x01;
|
||||
|
||||
//OVF disabled; CAPT enabled;
|
||||
TCB2.INTCTRL = 0x01;
|
||||
TCB3.INTCTRL = 0x03;
|
||||
|
||||
//OVF disabled; CAPT disabled;
|
||||
TCB2.INTFLAGS = 0x00;
|
||||
TCB3.INTFLAGS = 0x00;
|
||||
|
||||
//Temporary Value
|
||||
TCB2.TEMP = 0x00;
|
||||
TCB3.TEMP = 0x00;
|
||||
|
||||
//RUNSTDBY disabled; CASCADE disabled; SYNCUPD disabled; CLKSEL DIV1; ENABLE enabled;
|
||||
TCB2.CTRLA = 0x01;
|
||||
TCB3.CTRLA = 0x01;
|
||||
|
||||
EVSYS.CHANNEL0 = 0x48 + 0x05;
|
||||
EVSYS.SWEVENTA = 0x01;
|
||||
EVSYS.USERTCB3CAPT = 0x01;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -75,6 +80,7 @@ ISR (TCB3_INT_vect){
|
||||
uint16_t stewui = TCB3.CCMP;
|
||||
printf("CCMP %u", stewui);
|
||||
|
||||
TCB3.INTFLAGS = 0x03;
|
||||
//TCB3.INTFLAGS = PIN0_bm;
|
||||
|
||||
}
|
||||
|
||||
@ -35,6 +35,10 @@ int main() {
|
||||
|
||||
while (1) {
|
||||
//printf("loop")
|
||||
;
|
||||
uint16_t yo = TCB3.CNT;
|
||||
printf("CNT %u", yo);
|
||||
|
||||
uint16_t stewui = TCB3.CCMP;
|
||||
printf("CCMP %u", stewui);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user