We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello EveryOne,
I am using LPC2368 controller I am using timer0/counter in interrupt mode initially i set the value T0MR0 register 100 as shown in following program .this timer is running at 1 MHz frequency Suppose i want to change this value at run time . What changes i should do .
void init_timer0 (void) { T0PR = 0x0000003B; T0MR0 = 100; T0MCR = 0x03; T0TCR = 1; VICVectAddr4 = (UWORD32)tc0; VICIntEnable = 1 << 4; return; }
Not sure if there was a question hidden there somewhere.
Anyway - note that each timer can have up to four match register values. And for each match register, you could reset the timer (which would obviously only work well if used with the match register with the highest value). And for each match register, you could generate an interrupt. And for each match register, the hardware could control an output pin.
So you could control multiple windings with same timer without loading the processor with the interrupts, as long as the motor is run at constant velocity. With interrupts at end of the sequence you could reconfigure the match registers for increasing or decreasing the motor speed.