Giter VIP home page Giter VIP logo

Comments (6)

rm-hull avatar rm-hull commented on June 7, 2024 2

To be honest I would just source a different LCD board from ebay or aliexpress ... one where you wire it yourself

from luma.lcd.

rm-hull avatar rm-hull commented on June 7, 2024

By default PCD8544 driver is SPI compatible, hence the reason it is fixed to use the RPIs SPI interface pins.. this allows us to use the SPI hardware and the Linux kernel to drive the device efficiently. If you have bought a board which interfaces those lines to non-SPI griot header pins, then that is a poor decision by the board designer!

The only choice you have really is therefore to do what is called bit-banging in software .. this is what
https://github.com/pevandenburie/node-pcd8544-rpi/blob/master/src/PCD8544.cc#L812 does.

Luma.lcd will support bitbanging but I haven’t tried it for a while. Instead of SPI, you would need to look at using this serial interface instead:
https://github.com/rm-hull/luma.core/blob/master/luma/core/interface/serial.py#L118

from luma.lcd.

duchenpaul avatar duchenpaul commented on June 7, 2024

Thank you for your quick reply! πŸ˜„
I tried bitbang in your core before, seems not working.
I will take another look when I have time.
Below is my pin config, I think it is correct

cpuinfo screen raspberrypi pin mapping

from luma.lcd.

duchenpaul avatar duchenpaul commented on June 7, 2024

Hi @rm-hull
Hope it is something wrong on my side, I used below code, but no luck, nothing shows on my screen

please checkout Front pic to see what front looks like.

from luma.core.interface.serial import spi, bitbang
from luma.core.render import canvas
from luma.lcd.device import pcd8544

# serial = spi(port=0, device=1, gpio_DC=27, gpio_RST=23)
serial = bitbang(SCLK=17, SDA=18, CE=22 , DC=27 ,RST=23)
device = pcd8544(serial, rotate=1)

with canvas(device) as draw:
    draw.rectangle(device.bounding_box, outline="white", fill="black")
    draw.text((30, 40), "Hello World", fill="red")

Now that I won't use stock hardware SPI, I think below operation is meaningless, but I want to show you still

[ 22:22 - 192.168.2.107  ]
pi@Saturn ~/projects/PCD_8544_screen/python/test $ ls -l /dev/spi* 
crw-rw---- 1 root spi 153, 0 Dec  5 23:19 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Dec  5 23:19 /dev/spidev0.1
[ 22:23 - 192.168.2.107  ]
pi@Saturn ~/projects/PCD_8544_screen/python/test $ lsmod
Module                  Size  Used by
cmac                    3239  1
bnep                   12051  2
hci_uart               20020  1
btbcm                   7916  1 hci_uart
bluetooth             365780  24 hci_uart,bnep,btbcm
spidev                  7373  0
brcmfmac              292632  0
brcmutil                9863  1 brcmfmac
cfg80211              544545  1 brcmfmac
rfkill                 20851  6 bluetooth,cfg80211
snd_bcm2835            24427  0
snd_pcm                98501  1 snd_bcm2835
snd_timer              23968  1 snd_pcm
snd                    70032  3 snd_timer,snd_bcm2835,snd_pcm
bcm2835_gpiomem         3940  0
spi_bcm2835             7596  0
uio_pdrv_genirq         3923  0
fixed                   3285  0
uio                    10204  1 uio_pdrv_genirq
i2c_dev                 6913  0
ip_tables              13161  0
x_tables               20578  1 ip_tables
ipv6                  408900  43
[ 22:23 - 192.168.2.107  ]
pi@Saturn ~/projects/PCD_8544_screen/python/test $ 

from luma.lcd.

thijstriemstra avatar thijstriemstra commented on June 7, 2024

@duchenpaul got it to work?

from luma.lcd.

duchenpaul avatar duchenpaul commented on June 7, 2024

Yes, I will close it.

from luma.lcd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.