See attached picture. For the picture, i am constantly writing 8bit 0xAA. Channel1 is data, Channel2 is clock.
The main loop consists of
Thats all. I use the Port B2 for timing tests.[code] LATBbits.LATB2 = 1;
SPI2_RXTX_EBUF_8bit(0xAA);
LATBbits.LATB2 = 0;
My SPISettomgs:
I use the following for transfer:
[code] //init SPI
SPI2CON = SPI2CON2 = 0;
SPI2CONbits.MODE16 = 0; //1 for 16bit mode
SPI2CONbits.MODE32 = 0; //1 for 32bit mode
SPI2CONbits.CKE = 0;
SPI2CONbits.CKP = 1;
SPI2CONbits.ENHBUF = 1;
set->Baudrate = SPI2_Setbaud(set->Baudrate, pCLK);
SPI2CONbits.MSTEN = 1;
SPI2STATbits.SPIROV = 0;
SPI2CONbits.ON = 1;
Tools:[code]inline uint8_t SPI2_RXTX_EBUF_8bit(uint8_t data){
while(SPI2STATbits.SPITBF);
SPI2BUF = data;
return SPI2BUF;
}
- XC32 v 1.4
- MPLABX 3.51
- PICkit 3 (also for power)
The SPI-Code works fine on a PIC32MX470 and PIC32MX250. I dont remember any pauses from previous projects with PIC32 MX devices.
What am I doing wrong here?
Thanks for any help in advance!">
See attached picture. For the picture, i am constantly writing 8bit 0xAA. Channel1 is data, Channel2 is clock.
The main loop consists of
Thats all. I use the Port B2 for timing tests.[code] LATBbits.LATB2 = 1;
SPI2_RXTX_EBUF_8bit(0xAA);
LATBbits.LATB2 = 0;
My SPISettomgs:
I use the following for transfer:
[code] //init SPI
SPI2CON = SPI2CON2 = 0;
SPI2CONbits.MODE16 = 0; //1 for 16bit mode
SPI2CONbits.MODE32 = 0; //1 for 32bit mode
SPI2CONbits.CKE = 0;
SPI2CONbits.CKP = 1;
SPI2CONbits.ENHBUF = 1;
set->Baudrate = SPI2_Setbaud(set->Baudrate, pCLK);
SPI2CONbits.MSTEN = 1;
SPI2STATbits.SPIROV = 0;
SPI2CONbits.ON = 1;
Tools:[code]inline uint8_t SPI2_RXTX_EBUF_8bit(uint8_t data){
while(SPI2STATbits.SPITBF);
SPI2BUF = data;
return SPI2BUF;
}
- XC32 v 1.4
- MPLABX 3.51
- PICkit 3 (also for power)
The SPI-Code works fine on a PIC32MX470 and PIC32MX250. I dont remember any pauses from previous projects with PIC32 MX devices.
What am I doing wrong here?
Thanks for any help in advance!">
See attached picture. For the picture, i am constantly writing 8bit 0xAA. Channel1 is data, Channel2 is clock.
The main loop consists of
Thats all. I use the Port B2 for timing tests.[code] LATBbits.LATB2 = 1;
SPI2_RXTX_EBUF_8bit(0xAA);
LATBbits.LATB2 = 0;
My SPISettomgs:
I use the following for transfer:
[code] //init SPI
SPI2CON = SPI2CON2 = 0;
SPI2CONbits.MODE16 = 0; //1 for 16bit mode
SPI2CONbits.MODE32 = 0; //1 for 32bit mode
SPI2CONbits.CKE = 0;
SPI2CONbits.CKP = 1;
SPI2CONbits.ENHBUF = 1;
set->Baudrate = SPI2_Setbaud(set->Baudrate, pCLK);
SPI2CONbits.MSTEN = 1;
SPI2STATbits.SPIROV = 0;
SPI2CONbits.ON = 1;
Tools:[code]inline uint8_t SPI2_RXTX_EBUF_8bit(uint8_t data){
while(SPI2STATbits.SPITBF);
SPI2BUF = data;
return SPI2BUF;
}
- XC32 v 1.4
- MPLABX 3.51
- PICkit 3 (also for power)
The SPI-Code works fine on a PIC32MX470 and PIC32MX250. I dont remember any pauses from previous projects with PIC32 MX devices.
What am I doing wrong here?
Thanks for any help in advance!">
[code] LATBbits.LATB2 = 1;
SPI2_RXTX_EBUF_8bit(0xAA);
LATBbits.LATB2 = 0;[/code]
Thats all. I use the Port B2 for timing tests.[code] //init SPI
SPI2CON = SPI2CON2 = 0;
SPI2CONbits.MODE16 = 0; //1 for 16bit mode
SPI2CONbits.MODE32 = 0; //1 for 32bit mode
SPI2CONbits.CKE = 0;
SPI2CONbits.CKP = 1;
SPI2CONbits.ENHBUF = 1;
set->Baudrate = SPI2_Setbaud(set->Baudrate, pCLK);
SPI2CONbits.MSTEN = 1;
SPI2STATbits.SPIROV = 0;
SPI2CONbits.ON = 1;[/code]
I use the following for transfer:
[code]inline uint8_t SPI2_RXTX_EBUF_8bit(uint8_t data){
while(SPI2STATbits.SPITBF);
SPI2BUF = data;
return SPI2BUF;
}[/code]
Tools:
JLCPCB – Prototype 10 PCBs for $2 (For Any Color)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w