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.
I'm using the frequencies generated by the timers T3 and T6 for driving 2 stepper motors. The direction of the pins P3^1 and P3^3 equal 1. T3OE and T6OE equal 1 too. If timer 3 or timer 6 are generating an IRQ in the bootstrap mode the correspondending pins P3^1 / P3^3 are toggled. But if i load the program to flash, everything works, but on P3^1 and P3^3 there doesn't change anything. The program says, that T3OE and T6OE are set to 1, the timers are running, IRQs are working and T3OTL/T6OTL are toggling too. If I do the transitions on the pins manually:
sbit p_T3 = P3^3; sbit p_T6 = P3^1; ... void T3_timer_init() { T3=2000; T3CON = 0x0481; T3IC = 0x78; // ILVL=1110 GLVL=00 T3IE=1 } void T6_timer_init() { T6=300; T6CON = 0x0481; T6IC = 0x79; // ILVL=1110 GLVL=01 T3IE=1 } void interrupt_T3 (void) interrupt (0x23) { p_T3 = ~p_T3; // toggling P3^3 } void interrupt_T6 (void) interrupt (0x26) { p_T6 = ~p_T6; // toggling P3^1 } void main(void) { timer_init(); IEN=1; T3OE=1; T6OE=1; T3R=1; T6R=1; while(1); }
Both DP3.1 and P3.1 (DP3.3 and P3.3) have to be initialized to 1. Have you done that? Sauli
ehem ... no, i didn't initialize P3.3 and P3.1 :) thanks a lot, now it works Torsten