summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c39
1 files changed, 33 insertions, 6 deletions
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 <p24FV16KM202.h>
+#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;