Mr RB
Well-Known Member
Darn this has been biting me for about 20 minutes, but I have never really used the MSSP port for high speed stuff so I'm probably missing some little trick or something.
I have a PIC 18F452 running 10MHz xtal PLL so it's Fosc is 40Mhz and PIC is 10 MIPS.
The MSSP port is set for fosc/4 so it SHOULD give me a maximum data out bitrate of 10 Mbit/sec, that is even quoted in the datasheet.
But the very best I can get is 8.8 Mbit per second, it seems to always be using 9 clock periods to send 8 bits!!
I have stripped the code down to the simplest ASM and counted cycles etc etc, there's no way i can get this thing running at the quoted maximum 8 bits per 8 PIC cycles.
This is an example of the code I have been testing (although I have tried umpeen variations in testing);
I have tried re-arranging the order, adding nops removing nops etc but there seems no way it will send 8 bits in 8 PIC cycles (as claimed in the datasheet).
The output on SDO (RC5) should read 10 mips/8 or 125000 Hz, but it will only give me 111111 Hz which is 8/9ths of the correct speed.
I don't need to receive only to send data at 10 Mbit/sec.
So rather than pull my hair out for another 20 mins I thought of asking the people who know the MSSP port much better than I do.
I have a PIC 18F452 running 10MHz xtal PLL so it's Fosc is 40Mhz and PIC is 10 MIPS.
The MSSP port is set for fosc/4 so it SHOULD give me a maximum data out bitrate of 10 Mbit/sec, that is even quoted in the datasheet.
But the very best I can get is 8.8 Mbit per second, it seems to always be using 9 clock periods to send 8 bits!!
I have stripped the code down to the simplest ASM and counted cycles etc etc, there's no way i can get this thing running at the quoted maximum 8 bits per 8 PIC cycles.
This is an example of the code I have been testing (although I have tried umpeen variations in testing);
Code:
SSPSTAT = 0;
SSPCON1 = 0b00100000; // SSP on, fosc/4 (10 Mbit/sec)
blah: // 8 PIC cy loop
i = SSPBUF; // 2 cy
SSPBUF = 0b11110000; // 2 cy
asm nop; // 1 cy
SSPCON1.WCOL = 0; // 1 cy
goto blah; // 2 cy
I have tried re-arranging the order, adding nops removing nops etc but there seems no way it will send 8 bits in 8 PIC cycles (as claimed in the datasheet).
The output on SDO (RC5) should read 10 mips/8 or 125000 Hz, but it will only give me 111111 Hz which is 8/9ths of the correct speed.
I don't need to receive only to send data at 10 Mbit/sec.
So rather than pull my hair out for another 20 mins I thought of asking the people who know the MSSP port much better than I do.
Last edited: