I need to generate 10khz and 1khz square waces at P1.0 and P1.4 simultaneously
Clock = 1MHz
Am i on the right track?
1/10k = 100us -> timer0 mode2
1/1k = 1000us -> timer1 mode1
mov tmod, #12H; setting up timers
mov th0, #0CEH; -50cycles for timer 0 mode 2
setb tr0; start timer 0
setb tr1; start timer 1
mov ie,#8AH; setting interrupt enable register
this is where i'm stuck. do i/can i set two different waits for two different interrupts
or do i just put a wait (wt:sjmp wt) in and include it all in one interrupt? and set a count like it takes 10 interrupts of timer 0 (100us) to get 1 interrupt of timer 1 (1000us) so in the ISR code i'd put somehting like
interrupt code for timer (100us)
DJNZ R7, EXT; where R7 = 0AH
interrupt code for timer (1000us)
EXT: RETI
thanks for all the help in advance