Michael Havenga
Published © MIT

RADIX SIGNUM - PIC Dev Board for Large PIN Devices PT 1

Elevating your PIC development skills using devices with more I/O peripherals and extensibility.

AdvancedShowcase (no instructions)54
RADIX SIGNUM - PIC Dev Board for Large PIN Devices PT 1

Things used in this project

Hardware components

PIC18F
Microchip PIC18F
×1

Software apps and online services

mikroC PRO for PIC
MIKROE mikroC PRO for PIC

Story

Read more

Code

PIC Sample Code

C/C++
Sample code for testing the PIC development board.
char uart_rd;
unsigned int AnalogVal;

void SetupDevice(){
ADCON0.ADON  = 1;                     // Configure AN pins as digital
ADCON1.ADON  = 0;
ADCON2.ADON  = 0;
UART1_Init(9600);               // Initialize UART module at 9600 bps

Delay_ms(100);                  // Wait for UART module to stabilize
UART1_Write(10);
UART1_Write(13);
}

void main() {

SetupDevice();                  // Start Device

UART1_Write_Text("Start");
UART1_Write(10);
UART1_Write(13);

while (1) {                     // Endless loop
    AnalogVal = ADC_Read(1);
    
        if (UART1_Data_Ready()) {     // If data is received,
        uart_rd = UART2_Read();     // read the received data,
        UART2_Write(uart_rd);       // and send data via UART
        }
    }
}

Credits

Michael Havenga
2 projects • 0 followers

Comments