Menu

e-paper display

Help
2018-05-22
2018-09-27
  • David Stephenson

    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
  • Anobium

    Anobium - 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.

     
  • David Stephenson

    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).

     
  • stan cartwright

    stan cartwright - 2018-05-23

    I was looking at e paper displays out of interest. This uses 3.3V logic.

     
  • David Stephenson

    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.

     
    • stan cartwright

      stan cartwright - 2018-05-23

      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

       
    • stan cartwright

      stan cartwright - 2018-05-23

      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.

       
  • Anobium

    Anobium - 2018-05-23

    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

     
  • David Stephenson

    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)

    Sub InitPPS
    
            'Module: MSSP1
            SSP1CLKPPS = 0x0012    'RC2 > SCL1
            RC2PPS = 0x0018    'SCL1 > RC2 (bi-directional)
            RC0PPS = 0x0019    'SDO1 > RC0
    
    End Sub
    
     
    • Anobium

      Anobium - 2018-05-23

      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 call initwaveshare, add the debug to proove SPI and then end the program.

      What are the results?

       
  • David Stephenson

    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

     
    • Anobium

      Anobium - 2018-05-24

      Post the code you have built please.

       
  • David Stephenson

    Forget that FastHWSPITransfer is now giving clock signals (I had not specified the pin directions!).

     
    • Anobium

      Anobium - 2018-05-24

      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.

       
  • David Stephenson

    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.

     
    • Anobium

      Anobium - 2018-05-24

      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.

       
  • David Stephenson

    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).

     
    • Anobium

      Anobium - 2018-05-24

      Good to hear.

       
  • David Stephenson

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.