From fe7e5b97a50fa66aadb11e20b8f5210e1cb6dde6 Mon Sep 17 00:00:00 2001 From: Joshua Drake Date: Thu, 7 Mar 2024 12:48:29 -0600 Subject: Finished Arduino Program. --- main.c | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 01951e7..2b6547c 100644 --- a/main.c +++ b/main.c @@ -45,22 +45,49 @@ /** Section: Included Files */ -//#include "mcc_generated_files/system.h" -#include +#include "mcc_generated_files/system.h" +#include "SPI.h" /* Main application */ +uint8_t nullarray = {0x00, 0x00, 0x00}; int main(void) { // initialize the device - //SYSTEM_Initialize(); - //PORTB = 0b000000111110000; - TRISB = 0xff; + SYSTEM_Initialize(); + //OSCCONbits.SOSCEN = 0; + SPI_slaveDeselect(); + _LATA0 = _LATA1 = 1;//_LATA4 = 1; //Activate gate driver chips + _LATA4 = 1; + + SPI_slaveSelect(); + Message_HWCR(nullarray); + SPI_slaveDeselect(); + + _LATB6 = 0; + _LATB7 = 1; + _LATB8 = 1; + while (1) { - PORTB=0x00; + SPI_slaveSelect(); + Message_OUT(15, 5, 0); + SPI_slaveDeselect(); + /* + SPI_slaveSelect(); + Message_OUT(15, 5, 0); + SPI_slaveDeselect(); + + SPI_slaveSelect(); + Message_OUT(15, 5, 0); + SPI_slaveDeselect(); + + SPI_slaveSelect(); + Message_OUT(15, 5, 0); + SPI_slaveDeselect(); +*/ } return 1; -- cgit v1.2.3