PreviousNext
LED-MemoryMapping
Help > Custom DPA Handler > Examples > LED-MemoryMapping

The example shows the controlling of physical LEDs at TR by the peripheral RAM. A custom command byte is written to the 1st or 2nd byte of the RAM peripheral controls the red LED or green red respectively. It allows switching LED on, to switch off, to pulse, or to start pulsing.

 

→ Self-study tip: Currently the example always controls both LEDs regardless of the part of the RAM peripheral that was written to. Modify the code so it will check the actual byte range written to the RAM peripheral and control the appropriate LED(s) only.

 Hint: Use the ReceiveDpaRequest event to find out the address and length of data written to the peripheral RAM.