Hey,
I am trying to debug some code in Code Warrior. I have setup my PIT 0 to use the bus clock and count to 65:
SIM_SCGC6 = 0x800000;
PIT_TCTRL0 = 0x3UL;
PIT_LDVAL0 = 0x41UL;
Is there a way I can check so it is actually started and counting ?
In debug mode I can inspect the registers of the PIT, eg,
PIT_MCR0x0 0x40037000
PIT_LDVAL00x1964 0x40037100
PIT_CVAL00xb60 0x40037104
PIT_TCTRL00x3 0x40037108
PIT_TFLG00x1 0x4003710c
PIT_LDVAL10x0 0x40037110
PIT_CVAL10x0 0x40037114
PIT_TCTRL10x0 0x40037118
PIT_TFLG10x0 0x4003711c
PIT_LDVAL20x0 0x40037120
PIT_CVAL20x0 0x40037124
PIT_TCTRL2 0x0 0x40037128
PIT_TFLG2 0x0 0x4003712c
PIT_LDVAL3 0x0 0x40037130
PIT_CVAL3 0x0 0x40037134
PIT_TCTRL3 0x0 0x40037138
PIT_TFLG30x00x4003713c
Best regards,
Solved! Go to Solution.
PIT_LDVAL holds the value we compare against while PIT_CVAL contains the current value that is being counted.
PIT_LDVAL holds the value we compare against while PIT_CVAL contains the current value that is being counted.