Hi.
Is it possible to change SPI speed mid code?
My PIC is running at 64MHz (PIC18) and i need the SPI bus to run at <11MHz on startup.
After some initialisation code it needs to run at as close to 30MHz as possible, but not faster.
Can anyone give info on how to go about this?
SPI Speed Setup.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI Speed Setup.
Hello,
An 8-bit PIC running at 64MHz will have an instruction rate of 16MHz, I beleive the fastest SPI prescaler is /4 again so that will give you an absolute max SPI bit speed of 4MHz.
So maybe this speed can be used for everything?
Yes.Is it possible to change SPI speed mid code?
Are you using Flowcode or C? If Flowcode then what version?Can anyone give info on how to go about this?
An 8-bit PIC running at 64MHz will have an instruction rate of 16MHz, I beleive the fastest SPI prescaler is /4 again so that will give you an absolute max SPI bit speed of 4MHz.
So maybe this speed can be used for everything?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: SPI Speed Setup.
Hi,
This would be done in flowcode.
Currently using demo of V7. Have been talking with Steve briefly about our requirements
OK, so 4MHz looks like it will cover everything.
We will be moving this over to PIC32 soon, is there much difference. I expect the instruction rate will change as will the spi prescaler.
Its the PIC32MZ Series that we are considering using as they run pretty quick.
This would be done in flowcode.
Currently using demo of V7. Have been talking with Steve briefly about our requirements
OK, so 4MHz looks like it will cover everything.
We will be moving this over to PIC32 soon, is there much difference. I expect the instruction rate will change as will the spi prescaler.
Its the PIC32MZ Series that we are considering using as they run pretty quick.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: SPI Speed Setup.
Ok thanks that helps things.
The Flowcode 7 SPI component has a macro allowing you to re-configure the SPI prescaler on the fly during runtime.
8-bit PICs generally always have a /4 on the master clock.
16-bit PICs can vary but it is generally /2 or /4.
32-bit PICs seem to have a /2 but I could be wrong on this, I need to play more with them.
We are close to bringing out the ST ARM chip pack also which seems to have a /1 similar to AVR chips.
The Flowcode 7 SPI component has a macro allowing you to re-configure the SPI prescaler on the fly during runtime.
8-bit PICs generally always have a /4 on the master clock.
16-bit PICs can vary but it is generally /2 or /4.
32-bit PICs seem to have a /2 but I could be wrong on this, I need to play more with them.
We are close to bringing out the ST ARM chip pack also which seems to have a /1 similar to AVR chips.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel