Renesas RSKM16C6NK Technical Information Page 16

  • Download
  • Add to my manuals
  • Print
  • Page
    / 24
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 15
33. Right click on the ‘FlashLEDs()’; function and select
‘Go to cursor’.
The code will execute to the selected line and stop. An automatic breakpoint was inserted in the code and then removed after calling the
break.
34. Press ‘Step Over’ on the Debug Tool Bar.
The code will run and flash the LEDs 200 times. The debugger will not exit until all 200 flashes have completed or a button is pressed on the
RSK.
35. If the LEDs are still flashing press the SW1 button on the RSK to exit the flashLEDs() function.
The code will run to the breakpoint we previously set on the TimerADC function.
The TimerADC function initialises an interrupt on an available internal timer. On a compare match in the timer module an interrupt is
generated. In the TimerADC code version the interrupt reads the last ADC conversion for the external potentiometer and uses the result to
set the next compare match value. The ADC conversion is then re-started.
The interrupt initialisation is completed as part of the hardware setup. This is contained in the file ‘interrupts.c’.
36. Open the file ‘interrupts.c’ by double clicking on the file in the workspace view.
37. Review this file and find the interrupt function that changes the LED pins, TimerA0Handler(void).
38. Set a breakpoint on the line where the LED pins are modified.
39. Press <Go> or <F5> to run the code from the
current PC position.
The code will stop in the interrupt routine. It is now possible to step through the interrupt function.
40. Remove the breakpoint in the interrupt by double clicking again before exiting the function.
41. Press <Go> to run the code from the current PC
position.
The code will now run to the infinite loop at the end of Main. The user LEDs should now be flashing. You can modify the flashing rate by
adjusting the potentiometer on the board.
12
Page view 15
1 2 ... 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Comments to this Manuals

No comments