- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I have just started developing with the PSoC 6 Wi-Fi BT board in mbed. I am currently trying to connect it to an electronic paper display using SPI. The attached code worked on my NUCLEO-F746ZG, which I believe has pre-configured SPI pins. My question is does the PSoC have pre-defined SPI pins as of purchasing, or must they be configured in the ModusToolBox software as demonstrated in the SPI example code? If so, Is there a way to define the SPI pins in mbed?
Please let me know if you have any questions!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Ali-san,
CS P9_3 was my mistake, so I changed the pins as below
==============================
#define SCLK P9_2
#define MISO P9_1
#define MOSI P9_0
#define CS P9_4
#define DC P9_6
#define RST P9_7
#define BUSY P8_0
==============================
Then I probed
CS P9_4
MISO P9_1
MOSI P9_0
SCLK P9_2
The wave on my oscilloscope
So,the good news is that with this setting SPI I/F seems to be working.
Although I can not test further as I don't have the ePaper display,
I would suggest to try
(1) change frequency with other frequency refer to your data sheet of ePaper
e_spi.frequency(int h=1000000) ;
(2) change format, especially mode = 0, 1, 2, 3
e_spi.format(int bit, int mode=0) ;
Best Regards,
20-Sep-2019
Motoo Tanaka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
When I was developing in mbed, I usually used
D13 SCLK
D12 MISO
D11 MOSI
D10 CS0
In your ep29.h those pins were defined as
==================
#define MOSI P5_0 //DIN, blue
#define MISO P5_1 //unconnected
#define SCLK P5_2 //CLK, yellow
#define CS P5_7 //CS, orange
#define DC P5_6 //DC, green
#define RST P5_4 //RST, white
#define BUSY P5_5 //BUSY, purple
==================
So I changed it according to the pins of PSoC 6 WiFi-BT Pioneer Kit
PSoC 6 WiFi-BT Pioneer Kit | Mbed
==================
#define SCLK P12_2 // D13
#define MISO P12_1 // D12
#define MOSI P12_0 // D11
#define CS P12_3 // D10
#define DC P13_1 // D9
#define RST P13_0 // D8
#define BUSY P0_2 // D7
==================
Note, CS, DC, RST, BUSY can be anywhere as far as the pin support GPIO function(s)
As I don't have your epd, all I could was trying to compile the project and it was compiled OK.
Attached is my mbed project exported with your source code and headers with above modification.
But probably you can just add above change in ep29.h and retarget the board.
Let me know if it works or not when you have a chance to try.
moto
P.S. I deleted the attachment as it was useless.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Moto,
Thank you for the speedy reply. I am using the prototyping board, PSoC 6 Wi-Fi BT Prototyping Kit | Mbed. It doesn't seem share the same pin names as the pioneer kit you are referring too, so I haven't run your modified code, but I have tried running my code with pins whose primary functions are GPIO pins as designated from the table in this document: https://www.cypress.com/file/457891/download on page 10. Regardless of which pins I use I am not getting any response on my ePaper Display as I was on my nucleo board. Is there a command I need to use in Mbed to get the SCB to know that the chosen GPIO will be communicating by SPI as is shown in the modusToolBox SPI example: https://www.cypress.com/file/455556/download , when the SPI Master Resource Configuration (figures 1-4) are being set as desired?
Thanks,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Ali-san,
It would have been easier if you had written the board name in the beginning....
Anyway, I did the same for CY8CPROTO-062-4343W PSoC 6 Wi-Fi BT PROTOTYPEING KIT...
The kit has already assigned pins for a few SPIs to SD, PDM, and FLASH and
assuming that you have not detached any wings from the kit, the remaining pins are numbered.
By using PSoC Creator I assigned pins using the remaining pins as below
===============
#define SCLK P9_2
#define MISO P9_1
#define MOSI P9_0
#define CS P9_3
#define DC P9_4
#define RST P9_6
#define BUSY P9_7
================
At least the project could be compiled in my mbed workspace.
And without the epaper display this is about as far as I could go.
Best Regards,
19-Sep-2019
Motoo Tanaka
P.S. I deleted the attachment as it was not usable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Motoo,
Sorry about the confusion with the board. I have changed my code in the online mbed compiler to use the pins as you suggested but I still don't get any response on my display.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Ali-san,
CS P9_3 was my mistake, so I changed the pins as below
==============================
#define SCLK P9_2
#define MISO P9_1
#define MOSI P9_0
#define CS P9_4
#define DC P9_6
#define RST P9_7
#define BUSY P8_0
==============================
Then I probed
CS P9_4
MISO P9_1
MOSI P9_0
SCLK P9_2
The wave on my oscilloscope
So,the good news is that with this setting SPI I/F seems to be working.
Although I can not test further as I don't have the ePaper display,
I would suggest to try
(1) change frequency with other frequency refer to your data sheet of ePaper
e_spi.frequency(int h=1000000) ;
(2) change format, especially mode = 0, 1, 2, 3
e_spi.format(int bit, int mode=0) ;
Best Regards,
20-Sep-2019
Motoo Tanaka