Thanks Henrik I'll give it a try ..![]()
Thanks Henrik I'll give it a try ..![]()
- Ipsa scientia potestas est -
You’ll get data in & out of the master faster than PBP if you express both the read and write routines in a verbose fashion such as below write routine.
It might need delays between pin writes that could be as short as @nop commands, and the routine is also a candidate for RWM error without adding
a shadow register for port latching (mind you, PBP SHIFTOUT command is probably no different). It’s probably faster again if the chip has hardware SPI.
Code:byte data_out' WriteSPI: ‘ bit 7 SPICLOCK = 0’ SPIOUT = 0’ SPICLOCK = 0’ SPIOUT = data_out.bit7’ SPICLOCK = 1’ ‘ bit 6 SPICLOCK = 0’ SPIOUT = 0’ SPICLOCK = 0’ SPIOUT = data_out.bit6’ SPICLOCK = 1’ ‘ and so on for the rest of the bits… RETURN
Last edited by Art; - 9th November 2016 at 16:06.
I just tried SHIFTOUT with 64MHz oscillator and the clock frequency is 300kHz. At the same speed the MSSP module would be able to spit out data Fosc/4 but then your code wouldn't be able to keep up with feeding the module so it won't be a sustained 16MHz bitrate.
/Henrik.
Thanks for all the answers ..
I measured the SCK frequency 333 khz at 64 mhz so I wish pbp had a modification parameter for it (since we can't use all the pins for hardware SPI purpose)
Well , Maybe ART's suggestion may work .. as a subroutine .. Why not .. I'll try .. It shall be faster after all ..
Thanks once more to both of you
- Ipsa scientia potestas est -
It’s doesn’t “might” work, I play MP3s by using hardware SPI to read from SD card, and the above routine to write to the MP3 decoder.
Mind you, there are a few varieties of SPI you might have to experiment with (see the configuration of any pic with hardware SPI).
Bookmarks