Go Down

Topic: SPI on the arduino Due (Read 758 times) previous topic - next topic

MasterBarran

Hey,

I am trying to port a library across from the UNO to my due but I get these errors;




C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp: In constructor 'ISD1700::ISD1700(uint8_t)':
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:51:3: error: 'SPCR' was not declared in this scope
   SPCR = (1<<CPHA) | (1<<CPOL) | (1<<DORD) | (1<<SPE) | (1<<MSTR);
   ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:51:14: error: 'CPHA' was not declared in this scope
   SPCR = (1<<CPHA) | (1<<CPOL) | (1<<DORD) | (1<<SPE) | (1<<MSTR);
              ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:51:26: error: 'CPOL' was not declared in this scope
   SPCR = (1<<CPHA) | (1<<CPOL) | (1<<DORD) | (1<<SPE) | (1<<MSTR);
                          ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:51:38: error: 'DORD' was not declared in this scope
   SPCR = (1<<CPHA) | (1<<CPOL) | (1<<DORD) | (1<<SPE) | (1<<MSTR);
                                      ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:51:50: error: 'SPE' was not declared in this scope
   SPCR = (1<<CPHA) | (1<<CPOL) | (1<<DORD) | (1<<SPE) | (1<<MSTR);
                                                  ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:51:61: error: 'MSTR' was not declared in this scope
   SPCR = (1<<CPHA) | (1<<CPOL) | (1<<DORD) | (1<<SPE) | (1<<MSTR);
                                                             ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:52:11: error: 'SPSR' was not declared in this scope
   dummy = SPSR;
           ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:53:11: error: 'SPDR' was not declared in this scope
   dummy = SPDR;
           ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp: In member function 'uint8_t ISD1700::spi_transfer(uint8_t)':
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:74:3: error: 'SPDR' was not declared in this scope
   SPDR = data;
   ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:75:12: error: 'SPSR' was not declared in this scope
   while (!(SPSR & (1<<SPIF)));
            ^
C:\Users\chris\Documents\Arduino\libraries\ISD1700_Due\ISD1700_due.cpp:75:23: error: 'SPIF' was not declared in this scope
   while (!(SPSR & (1<<SPIF)));
                       ^
Error compiling.


I guessing they are UNO registers that the DUE doesnt have but I dont know where to start to get to a point where I can fix them.

chiquito112

There is an update of the library to avoid this.

Go Up