System Development
Coding Examples
Basic Setup
6min
For more information about the PIC16F18875 | PIC16F18877
In the code sample below, the device is set up to use PORTB and PORTE to flash an LED. This is a simple project and is often used as a "heartbeat" to ensure that the device is working.
The code sample below is written in Mikro C, available from Mikroe.
The code is initiated by first setting up the device and then going into a continual loop flashing the designated pin.
The device setup does the following:
- The analogs for each port are disabled, as we will be using them as digital I/O.
- All the pins are set to input
- Ony the designated pins are set for outputs
- Comparators are also disabled
The pin on PORT# Bit 0 is toggled once every 500ms
The sample described above is listed below. Use the copy function to extract the code for use.
๏ปฟ
To complete this project the following is needed:
- Radix Duo (with PIC16F18875 | PIC16F18877) + Radix Shield
Alternatively, you may use the following
- Radix Duo (with PIC16F18875 | PIC16F18877)
- 820 Ohm Resistor
- 3 or 5 mm LED
[END]