I was 'brought up' on PIC, so I'm a bit of a nube with the 8051 based micro. Using the ADuC842 from analog devices.
I would like to provide a clock output from my microcontroller, at about 100 KHz, im clocking my micro at about 11MHz. Seems in my mind to be a very simple task. Is it possible to simply program a timer to toggle an output port? It seems the timers can only provide a software interrupt so I would need to interrupt the program to simply toggle the bit. I would rather use my interrupt for other more complex async operations, and I'd rather not interrupt my program every 100 steps or so.
Was wondering is there an easier way to provide a clock output?
Yes. You place a value in the timer so that it will increment and cause an overflow. The program jumps to the ISR then complements the pin. In the original 8051, with a 12MHZ crystal, the timer incremented every 1us.
I was 'brought up' on PIC, so I'm a bit of a nube with the 8051 based micro. Using the ADuC842 from analog devices.
I would like to provide a clock output from my microcontroller, at about 100 KHz, im clocking my micro at about 11MHz. Seems in my mind to be a very simple task. Is it possible to simply program a timer to toggle an output port? It seems the timers can only provide a software interrupt so I would need to interrupt the program to simply toggle the bit. I would rather use my interrupt for other more complex async operations, and I'd rather not interrupt my program every 100 steps or so.
Was wondering is there an easier way to provide a clock output?
If you don't want to use interrupt or timer routine for clock output,
then you can make use of Delay routine.
Advantage: Simple program
Disadvantage: You can not perform any other operation while delay routine is executed.