address 0 ---> goto INIT ; First instruction executed when RESET is complete
Right now i have only got the codes for the address xx------> INIT part but the what about the MAIN LOOP?
Rich (BB code):
...
address xx --->INIT:
Initialize registers for port pins
Initialize and configure A/D Converter
Initialize and configure PWM
Initialize register file variables
...
...
address yy ----> MAIN_LOOP:
Start an A/D conversion
While(A/D converter is busy) do nothing
Read 10 bit A/D result
Copy A/D result into PWM duty cycle register
For 10 milliseconds -- do nothing
goto MAIN_LOOP