I am trying e-paper displays again. They seem to have improved both in speed of refresh and power consumption in the last few years. So I have got a waveshare 1.54" (200x200 pixel) display.
I can't seem to get it to do anything at the moment and I'm not sure whether it is the SPI that is giving the problems or the commands to the display.
It is a one way SPI (so the SDI pin on the master is not used) so I have tried the FastHWSPITransfer command (which I have never used before - so I'm not sure I am doing it right).
Anyway I have attached the code - if anybody can give me any insights it would be welcome.
Yes it uses 3.3V supply and logic (I like to use 2xAAA to power my circuits).
I found them on the UK site "modmypi.com" (I don't really like to order from China) .
As the name suggests they are really set up to use with the raspberry pi.
I always seem to have problems with SPI communication.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
FastHWSPITransfer I hadn't looked at but you've brought it to my attention.
I use a 18f25k22 and 328p and both have hardware spi and always used the pins/sockets but I just used spi.... and I'm not much understanding spi. Will FastHWSPITransfer make my spi displays faster?
I thought e paper displays didn't need fast, more like 100 ms delays to respond.
Good luck with adding new displays.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can you post again the code after using the PPS Tool to set the ports? I am able to tell where those paramters for PPS came from. If they are hand crafted please use PPS Tool, retest and repost.
Cheers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you know if SPI is working? So, just before initwaveshare add some test code to ensure SPI is working. Send a byte and get a byte displaying on a serial terminal to ensure we have have communications. This will then rule any issue from all the ports you have set after SPIMode Masterfast,0. You will have to, for this test, change to SPITransfer. So, you run down to about line 36, do not call initwaveshare, add the debug to proove SPI and then end the program.
What are the results?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've tried checking the spi clock on an oscilloscope. FastHWSPITransfer does not seem to work (no clock pulses seen)
If I replace with spitransfer I can see the clock signals (and the data signals) .
The other thing is the help file says that if there is no data to recieve you can use
spitransfer databyte, 0
but the compiler does not like the 0 (see below)
wavesharesw.gcb (44): Error: 0 is not a variable and cannot be used for the parameter HWSPITRANSFER
wavesharesw.gcb (46): Error: 0 is not a variable and cannot be used for the parameter HWSPITRANSFER
wavesharesw.gcb (47): Error: 0 is not a variable and cannot be used for the parameter HWSPITRANSFER...etc
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes, the purpose is to inspect and ensure the spi lines are set correctly. if you have proceeded with FastHWSPITransfer and not proven SPITransfer can send and receive then you have not validated SPI communications.
It would be best to complete send and receive SPITransfer tests before proceeding.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Problem is that there is no return communications - the display is write only. It does have a "busy" pin (which I did not bother to connect) maybe that will give some clue as to whether there is communications.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's now doing something (the display is clearing). There was a problem in my code I had put in 0xC0 instaed of 0x0C. I also noticed a problem on the board - there is a 24 pin connector and two of the pins were shorted, there was also a capacitor missing on the board (fortunately I had a 1uF surface mount).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the help (sometimes it's just a matter of putting the problem in writing to get closer to the solution). I have uploaded an image of it un-powered just to show it works. The characters are 16x13 pixels so the pixels on the display are very fine.
I am still confused by the two memory areas on the display driver as they seem to display alternately, but only one seems to be writable.
I am trying e-paper displays again. They seem to have improved both in speed of refresh and power consumption in the last few years. So I have got a waveshare 1.54" (200x200 pixel) display.
I can't seem to get it to do anything at the moment and I'm not sure whether it is the SPI that is giving the problems or the commands to the display.
It is a one way SPI (so the SDI pin on the master is not used) so I have tried the FastHWSPITransfer command (which I have never used before - so I'm not sure I am doing it right).
Anyway I have attached the code - if anybody can give me any insights it would be welcome.
Last edit: David Stephenson 2018-05-22
Sure. I will
What happened to the ILI9326 GLCD driver? I have allocated an unique ID but I an update would be good.
ILI9326 driver resolved, see https://sourceforge.net/p/gcbasic/discussion/629990/thread/8f5bf76956/?limit=250
I was stalling. I often find under these circumstances it is better to give it a rest then come back to it later (I also had other work to attend to).
I was looking at e paper displays out of interest. This uses 3.3V logic.
Yes it uses 3.3V supply and logic (I like to use 2xAAA to power my circuits).
I found them on the UK site "modmypi.com" (I don't really like to order from China) .
As the name suggests they are really set up to use with the raspberry pi.
I always seem to have problems with SPI communication.
I'm wary about ebay chinese stuff too. I've had duff displays and return postage is more than the display. Bit more expensive but uk ltd.
2xAAA is cool.
https://www.modmypi.com/raspberry-pi/screens-and-displays/epaper/eink-display-module-spi-1.54-200x200
FastHWSPITransfer I hadn't looked at but you've brought it to my attention.
I use a 18f25k22 and 328p and both have hardware spi and always used the pins/sockets but I just used spi.... and I'm not much understanding spi. Will FastHWSPITransfer make my spi displays faster?
I thought e paper displays didn't need fast, more like 100 ms delays to respond.
Good luck with adding new displays.
Code review.
Can you post again the code after using the PPS Tool to set the ports? I am able to tell where those paramters for PPS came from. If they are hand crafted please use PPS Tool, retest and repost.
Cheers
It comes from the PPS tool. I've run it again...
16F18326 RC2-->clock, RC0-->SDO on module 1 (this chip has two MSSP modules)
Great.
I will start as I would.
Do you know if SPI is working? So, just before initwaveshare add some test code to ensure SPI is working. Send a byte and get a byte displaying on a serial terminal to ensure we have have communications. This will then rule any issue from all the ports you have set after
SPIMode Masterfast,0
. You will have to, for this test, change to SPITransfer. So, you run down to about line 36, do not callinitwaveshare
, add the debug to proove SPI and then end the program.What are the results?
I've tried checking the spi clock on an oscilloscope. FastHWSPITransfer does not seem to work (no clock pulses seen)
If I replace with spitransfer I can see the clock signals (and the data signals) .
The other thing is the help file says that if there is no data to recieve you can use
spitransfer databyte, 0
but the compiler does not like the 0 (see below)
wavesharesw.gcb (44): Error: 0 is not a variable and cannot be used for the parameter HWSPITRANSFER
wavesharesw.gcb (46): Error: 0 is not a variable and cannot be used for the parameter HWSPITRANSFER
wavesharesw.gcb (47): Error: 0 is not a variable and cannot be used for the parameter HWSPITRANSFER...etc
Post the code you have built please.
Forget that FastHWSPITransfer is now giving clock signals (I had not specified the pin directions!).
yes, the purpose is to inspect and ensure the spi lines are set correctly. if you have proceeded with FastHWSPITransfer and not proven SPITransfer can send and receive then you have not validated SPI communications.
It would be best to complete send and receive SPITransfer tests before proceeding.
Problem is that there is no return communications - the display is write only. It does have a "busy" pin (which I did not bother to connect) maybe that will give some clue as to whether there is communications.
OK.
Disconnect the display.
Loop SPIout and SPIin (whatever they are called).
Using SPITransfer byteout, bytein, then display the byteon on a serial terminal this will proove the SPI is set up.
I always do this first - need to ensure the basics of SPI are correct before progressing. I also hook an protcol analyser.
It's now doing something (the display is clearing). There was a problem in my code I had put in 0xC0 instaed of 0x0C. I also noticed a problem on the board - there is a 24 pin connector and two of the pins were shorted, there was also a capacitor missing on the board (fortunately I had a 1uF surface mount).
Good to hear.
Thanks for the help (sometimes it's just a matter of putting the problem in writing to get closer to the solution). I have uploaded an image of it un-powered just to show it works. The characters are 16x13 pixels so the pixels on the display are very fine.
I am still confused by the two memory areas on the display driver as they seem to display alternately, but only one seems to be writable.