summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJoshua Drake <joshua.ellis.drake@gmail.com>2024-03-07 12:48:29 -0600
committerJoshua Drake <joshua.ellis.drake@gmail.com>2024-03-07 12:48:29 -0600
commitfe7e5b97a50fa66aadb11e20b8f5210e1cb6dde6 (patch)
tree0ae70b523a873f04221fc3f492c6e2a65b3f7252 /main.c
parentef97092cd93ce28fb72980e7594a80577545016f (diff)
Finished Arduino Program.
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;