Good Morning
I am amateur in the area and I am not understanding what is the prescale.
For example when adding the SPI component.
Could you possibly can explain me grateful.
Greetings
Emanuel Lourenço
Prescale
- 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: Prescale
Hello,
The SPI prescale is a division of the master instruction clock. So say the oscillator is running at 4MHz.
PIC 8-Bit & dsPIC30 = Instruction clock = Osc / 4 = 1MHz
PIC24 / dsPIC33 = Instruction clock = Osc / 2 = 2MHz
AVR = Instruction clock = Osc = 4MHz
So an 8-bit PIC with an Osc speed of 4MHz and a prescaler of 4 the SPI clock would be equal to 250K bits per sec when sending or receiving data.
The SPI prescale is a division of the master instruction clock. So say the oscillator is running at 4MHz.
PIC 8-Bit & dsPIC30 = Instruction clock = Osc / 4 = 1MHz
PIC24 / dsPIC33 = Instruction clock = Osc / 2 = 2MHz
AVR = Instruction clock = Osc = 4MHz
So an 8-bit PIC with an Osc speed of 4MHz and a prescaler of 4 the SPI clock would be equal to 250K bits per sec when sending or receiving data.
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
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
Re: Prescale
Thanks for the explanationBenj wrote:Hello,
The SPI prescale is a division of the master instruction clock. So say the oscillator is running at 4MHz.
PIC 8-Bit & dsPIC30 = Instruction clock = Osc / 4 = 1MHz
PIC24 / dsPIC33 = Instruction clock = Osc / 2 = 2MHz
AVR = Instruction clock = Osc = 4MHz
So an 8-bit PIC with an Osc speed of 4MHz and a prescaler of 4 the SPI clock would be equal to 250K bits per sec when sending or receiving data.
I think I understood.
So if I have a dsPIC33 clocked at 4 MHz, and a prescale of osc / 4.
I'll take 500 kbits per second right?
Greetings
- 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: Prescale
Sounds right to meSo if I have a dsPIC33 clocked at 4 MHz, and a prescale of osc / 4.
I'll take 500 kbits per second right?

4MHz / 2 / 4 = 500KHz.
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
-
- Posts: 63
- Joined: Mon Dec 23, 2013 5:51 pm
- Been thanked: 8 times
Re: Prescale
Thanks for the explanationBenj wrote:Sounds right to meSo if I have a dsPIC33 clocked at 4 MHz, and a prescale of osc / 4.
I'll take 500 kbits per second right?![]()
4MHz / 2 / 4 = 500KHz.

Very good explanation