Pic32mx230 slow spi clock
Moderator: Benj
-
- Posts: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Pic32mx230 slow spi clock
Hello
We are trying to use a ili9341 on pic32mx230f256B
We are successfully implement the macro glcd_ili9341. The display turn on and images appear on the screen.
We have only problem, the speed. Running at a very low speed
by measuring the clock on the sck pin we get 1.1-1.2Mhz.
Did any of you find the same difficulties with spi?
In attachment the clock configuration of pic32
The system clock running at 40Mhz (checked)
Best regards
We are trying to use a ili9341 on pic32mx230f256B
We are successfully implement the macro glcd_ili9341. The display turn on and images appear on the screen.
We have only problem, the speed. Running at a very low speed
by measuring the clock on the sck pin we get 1.1-1.2Mhz.
Did any of you find the same difficulties with spi?
In attachment the clock configuration of pic32
The system clock running at 40Mhz (checked)
Best regards
- Attachments
-
- MX230F256B_config.pdf
- (233.65 KiB) Downloaded 203 times
-
- Valued Contributor
- Posts: 654
- Joined: Fri Aug 19, 2016 2:09 pm
- Location: switzerland
- Has thanked: 182 times
- Been thanked: 179 times
- Contact:
Re: Pic32mx230 slow spi clock
Hello
Are you using a software SPI or hardware? Maybe you can post a printscreen from the SPI config.
regards
Stefan
Are you using a software SPI or hardware? Maybe you can post a printscreen from the SPI config.
regards
Stefan
-
- Posts: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi Stefan
Thanks for reply.
We don't call directly spi interface, we use the pin configuration in glcd_ili9341 .
In attachment the program
Best Regards
Thanks for reply.
We don't call directly spi interface, we use the pin configuration in glcd_ili9341 .
In attachment the program
Best Regards
- Attachments
-
- Flowcode8_display_ILI9341.pdf
- (264.51 KiB) Downloaded 223 times
- 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: Pic32mx230 slow spi clock
Hello,
I've created a new ILI9341 SPI component for you which has the SPI CAL built in rather then simply bit banging out the data to the display.
Hopefully it should run significantly faster but has the downside now of having limited fixed hardware SPI pins and also the MISO pin connection. Note this isn't actually used and so doesn't need to connect to anything on the display. It's only listed as a heads up that you won't be able to use the pin for anything else.
Use the updates system to download the new component.
Let us know how you get on.
I've created a new ILI9341 SPI component for you which has the SPI CAL built in rather then simply bit banging out the data to the display.
Hopefully it should run significantly faster but has the downside now of having limited fixed hardware SPI pins and also the MISO pin connection. Note this isn't actually used and so doesn't need to connect to anything on the display. It's only listed as a heads up that you won't be able to use the pin for anything else.
Use the updates system to download the new component.
Let us know how you get on.
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: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi benj
Thanks for reply.
We tried to insert the new cal but when we compile it returns this error
Unknown or missing port variable: $PORTC.2
best regards
Thanks for reply.
We tried to insert the new cal but when we compile it returns this error
Unknown or missing port variable: $PORTC.2
best regards
- Attachments
-
- MX230F256B_SPI_HW_new.pdf
- (226.69 KiB) Downloaded 198 times
-
- Posts: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi Benj
thanks for reply
We have downloaded the new cal, but when we try to compile it returns the following error
display_test_9341_SPI_new_image_01_macro_test.c : 3788:error : Unknown or missing port variable: $PORTC.2
display_test_9341_SPI_new_image_01_macro_test.c : 3957:error : Unknown or missing port variable: $PORTC.2
best regards
thanks for reply
We have downloaded the new cal, but when we try to compile it returns the following error
display_test_9341_SPI_new_image_01_macro_test.c : 3788:error : Unknown or missing port variable: $PORTC.2
display_test_9341_SPI_new_image_01_macro_test.c : 3957:error : Unknown or missing port variable: $PORTC.2
best regards
- Attachments
-
- MX230F256B_SPI_error_compilation.pdf
- (226.39 KiB) Downloaded 191 times
-
- MX230F256B_SPI_HW_new.pdf
- (226.69 KiB) Downloaded 187 times
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi
Please stop to post pdf images !
No body can debug pdf's please post your flowchart !
Please stop to post pdf images !
No body can debug pdf's please post your flowchart !
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR
- 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: Pic32mx230 slow spi clock
Hello,
It's compiling ok here for me on a PIC32MX device. Please can you check the component properties that all the pins and remap pins have correctly been allocated.
As stated by Qmesar we can't do much to debug your pdf documents, just attach the fcfx flowcode project and that should save you some time and allow us to investigate.
It's compiling ok here for me on a PIC32MX device. Please can you check the component properties that all the pins and remap pins have correctly been allocated.
As stated by Qmesar we can't do much to debug your pdf documents, just attach the fcfx flowcode project and that should save you some time and allow us to investigate.
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: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi benj
the version of pic we are using does not have the c port ( PIC32MX230F256H)
If you try to compile it, it will return the error
In attachment the flowchart.
Best regards
the version of pic we are using does not have the c port ( PIC32MX230F256H)
If you try to compile it, it will return the error
In attachment the flowchart.
Best regards
- Attachments
-
- Display_test_9341_SPI_new_image_01.fcfx
- (15.37 KiB) Downloaded 186 times
- 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: Pic32mx230 slow spi clock
Hello,
Many thanks I've found the cause of the problem now. The auto CS was left enabled in the SPI CAL component. I've now disabled this and pushed to the update system again. Fingers crossed if you update the component then it should now be fixed and compile correctly.
Many thanks I've found the cause of the problem now. The auto CS was left enabled in the SPI CAL component. I've now disabled this and pushed to the update system again. Fingers crossed if you update the component then it should now be fixed and compile correctly.
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: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi benj
we downloaded the new release and ...... it works!
now we are pushing the bus to the limit
Many thanks
we downloaded the new release and ...... it works!
now we are pushing the bus to the limit
Many thanks
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi Ben!
I can see that it is for Pic32 But has it any affect on Arduino? If not, is it possible to speed the SPI up for ili9341 on Arduino also?
Br Jorgen
I can see that it is for Pic32 But has it any affect on Arduino? If not, is it possible to speed the SPI up for ili9341 on Arduino also?
Br Jorgen
-
- Posts: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: Pic32mx230 slow spi clock
Hello
When program call gLCD_ili9341_spi how there set this registers?
REGISTER SPI1CON
REGISTER SP1BRG
REGISTER SPI1CON2
Is it possible read the value of this register in flowcode .C output?
Now spi is running at 24 Mhz, in according to our pic datasheet is the maximum value.
Data Spi is 8bit framed. Is it possible increase to 32bit framed?
Best regards
When program call gLCD_ili9341_spi how there set this registers?
REGISTER SPI1CON
REGISTER SP1BRG
REGISTER SPI1CON2
Is it possible read the value of this register in flowcode .C output?
Now spi is running at 24 Mhz, in according to our pic datasheet is the maximum value.
Data Spi is 8bit framed. Is it possible increase to 32bit framed?
Best regards
- 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: Pic32mx230 slow spi clock
Hello,
The old ILI9341 component uses bit banged SPI using standard I/O.
The new ILI9341_SPI component uses the SPI CAL and so can use Hardware SPI on any target, including Arduino. Should run faster but downside is you loose the pin assigned to the SPI MISO.
The SPI properties can be set via the component properties. To see the code that accesses the SPI registers you would have to look in the CAL/FAMILY/CAL_FAMILY_SPI.c file.
You can read registers by using a C icon in your Flowcode project. first create a Flowcode variable called reg. Then add the following code into a C code icon and it will load the reg variable with the value from the register.
The old ILI9341 component uses bit banged SPI using standard I/O.
The new ILI9341_SPI component uses the SPI CAL and so can use Hardware SPI on any target, including Arduino. Should run faster but downside is you loose the pin assigned to the SPI MISO.
The SPI properties can be set via the component properties. To see the code that accesses the SPI registers you would have to look in the CAL/FAMILY/CAL_FAMILY_SPI.c file.
You can read registers by using a C icon in your Flowcode project. first create a Flowcode variable called reg. Then add the following code into a C code icon and it will load the reg variable with the value from the register.
Code: Select all
FCV_REG = SPI1CON;
We don't currently support this though I'll add it to the list for future investigation.Data Spi is 8bit framed. Is it possible increase to 32bit framed?
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: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi benj
thanks for reply
we try to compile the program using the display with ILI9341 in HW SPI on a faster PIC32MX440F256H.
The compiler shows an error. It is possible to solve?
is it possible to improve the speed of the Bitmap Drawer component?
Best Regards
thanks for reply
we try to compile the program using the display with ILI9341 in HW SPI on a faster PIC32MX440F256H.
The compiler shows an error. It is possible to solve?
is it possible to improve the speed of the Bitmap Drawer component?
Best Regards
- Attachments
-
- Display_ILI9341_MX440_new.msg.txt
- (2.45 KiB) Downloaded 106 times
-
- Display_ILI9341_MX440_new.fcfx
- (20.29 KiB) Downloaded 122 times
- 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: Pic32mx230 slow spi clock
Hello,
It seems this device doesn't have a channel 1 but does have a channel 2, please can you check the component properties have been set correctly.we try to compile the program using the display with ILI9341 in HW SPI on a faster PIC32MX440F256H.
It should already be fairly efficient, though I can certainly have a look.is it possible to improve the speed of the Bitmap Drawer component?
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: 143
- Joined: Mon Aug 20, 2018 11:04 am
- Has thanked: 42 times
- Been thanked: 41 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi benj
Thanks for you reply, now we are running on pic32mx440f256h at 40Mhz on spi.
You can see the screenshot of the oscilloscope.
In the second image, it is possible to note the time interval between a data packet and another. 1.780uS.
Is it possible reduce the time interval between data packet?
we have to load several bitmap as fast as possible
Best regards
Thanks for you reply, now we are running on pic32mx440f256h at 40Mhz on spi.
You can see the screenshot of the oscilloscope.
In the second image, it is possible to note the time interval between a data packet and another. 1.780uS.
Is it possible reduce the time interval between data packet?
we have to load several bitmap as fast as possible
Best regards
- Attachments
-
- IMG_4828.JPG (115.16 KiB) Viewed 7292 times
-
- IMG_4827.JPG (124.53 KiB) Viewed 7292 times
-
- Posts: 170
- Joined: Fri Jul 15, 2016 9:51 pm
- Has thanked: 69 times
- Been thanked: 61 times
- Contact:
Re: Pic32mx230 slow spi clock
Hi Ben,
I also experienced this phenomenon.
I am using PIC32MX370F512H MCU.
Would it be possible to shorten the time between sent bytes of the SPI bus ?
Best Regards,
Lagoda
I also experienced this phenomenon.
I am using PIC32MX370F512H MCU.
Would it be possible to shorten the time between sent bytes of the SPI bus ?
Best Regards,
Lagoda