Professional Documents
Culture Documents
Discussion Conclusion Lab 4 Embeded
Discussion Conclusion Lab 4 Embeded
Next step, we go through to change PSA and TOPS<2:0) bits of the TOCON or Timer0
module register which determine the prescalar assignment and prescalar ratio to 1:8 or 1:256.
We change the TOCON to 0b11000010 and Tops to 1:8 , 0b11000111 and Tops to 1.256
based on PIC18F45K22 datasheet. This have state on it and we just follow the instructions.
Save data and run the program and check the output that are connected to trainer board and
observe the LED will light up depends on timer.
Then, we put the TOCON register in original setting ob11000101. We change the code for
OSCON or Oscillator Control register change the in internal oscillator 4 MHZ to 16MHZ
refer to datasheet page 32. We change OSCON to Ox72 and get the output so the TOCON
stay in original setting, save the files and run the simulation check the output on the trainer
board. Next, same step to OSCON Ox52.
Lastly, we put the TOCON register and OSCON register in original setting, back to
normal that are state. Then, change TMROL register to = TMROL 10.Refer to code given,
and we just change the TMROL before this 100 to 10. So, save the files and run simulation
and reset on trainer board and observe the output of LED will light up.
CONCLUSION