Recent

Author Topic: LCD Displays on Pi or Beaglebone  (Read 8578 times)

jcdammeyer

  • Full Member
  • ***
  • Posts: 195
  • Embedded System Developer
    • Automation Artisans Inc.
Re: LCD Displays on Pi or Beaglebone
« Reply #30 on: May 27, 2021, 09:02:40 am »
Thanks Avra.  I'll check those out.  I was thinking that if I wanted 4 SPI devices I'd use a 2:4 mux with GPIO pins enabled with the SPI0 CS.  But the code has to expressly do that.  I don't think the Beagle by itself can select 1 of 4 SPI devices. 
I used SPI muxing like that on my ELS project.  Schematics accessible by clicking on each green block.
http://www.autoartisans.com/ELS/

Tonight I connected the small SSD1306-128x64 I2C display.  I edited the pxl sample to point to the correct media folder and for the proper screen size along with i2c-2.  Worked first time. 

The Beagle has 3 I2C ports.
debian@ebb:~/lazarus/TC$ ls /dev/i2c*
/dev/i2c-0  /dev/i2c-1  /dev/i2c-2

At this point i should be able to ready the K Type Thermocouple via SPI and display it on the tiny OLED display.

My goal with the displays and sensors is to be able to create a Window'd type screen that has a an area defined for the display of interest and fields that a user can enter in values that duplicate what comes from SPI sensors.   The paint call would also do the     

// Send picture to the display.
    FDisplay.Present;

So that way I can develop and test on a full size PC fast compile and then when done on the beagle or Pi displays on the HDMI if there but also paints it out to the I2C or SPI display.





avra

  • Hero Member
  • *****
  • Posts: 2262
    • Additional info
Re: LCD Displays on Pi or Beaglebone
« Reply #31 on: May 27, 2021, 09:22:20 am »
I don't think the Beagle by itself can select 1 of 4 SPI devices.
With little trick you can connect as much as you wish:
https://raspberrypi.stackexchange.com/questions/71448/how-to-connect-multiple-spi-devices-adcs-to-raspberry-pi

Schematics accessible by clicking on each green block.
http://www.autoartisans.com/ELS/
Ah, good old Protel. Brings back some memories...

My goal with the displays and sensors is to be able to create a Window'd type screen
You can still use LCL for such design. You create a form in designer with the same dimensions as your display, and update it in runtime as normal. You just don't show it, and have a thread or timer which periodically transfers bitmap to SPI or I2C display. You can even cache last shown bitmap to decide which display parts do not need an update.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

jcdammeyer

  • Full Member
  • ***
  • Posts: 195
  • Embedded System Developer
    • Automation Artisans Inc.
Re: LCD Displays on Pi or Beaglebone
« Reply #32 on: May 27, 2021, 09:40:20 am »
My goal with the displays and sensors is to be able to create a Window'd type screen
You can still use LCL for such design. You create a form in designer with the same dimensions as your display, and update it in runtime as normal. You just don't show it, and have a thread or timer which periodically transfers bitmap to SPI or I2C display. You can even cache last shown bitmap to decide which display parts do not need an update.
Exactly.  Instead of having an HDMI that shows the entire desktop for an embedded system we're really just interested in a subset of the main screen.  Hence write to a canvas and as you say, periodically update the SPI/I2C display(s).

For example, on the Beagle, the MachineKit system creates the standard LinuxCNC screen.  What MachineKit provides with trajectory planning etc is fantastic.  But not everyone wants to learn G-Code.  That's why my ELS was useful for some.  An ELS-Mill for milling machines in essence would give power feed to 3 or 4 axis along with simple start stop locations.  Or, and this would be the really great part, to also parse and run G-code when needed.

And I'd use Lazarus for this as the interface to MachineKit instead of Python and other stuff.

 

TinyPortal © 2005-2018