Onboard displays

Any update on the BOM?

Yes, thanks for the reminder - I am going to build up a couple of these boards this week, so at that time will post.

Thanks,

DougM

Ok here we go:

R1, R3, R6 - these are the three resistors directly underneath the uSD card holder - 0603 47 ohm resistors. They are the current limiters for the TFT backlight

C48 is an 0603 0.1uF cap

U$33 is a TPS73633DBVR regulator - drops 5v from VESC down to 3.3v

Q1 is a BSS215P - turns the TFT backlight on and off

R7 is 100k 0603

The Teensy you can solder directly, but I would get a chip carrier like a Digi-Key AE10004-ND

you will need to use GND, +5V (not +5V1!), TX3 and RX3 to talk to the VESC. I use 3.5mm screwterms like digi-key 277-8588-ND which is comprised of 2- and 3- position screwterms that you can configure any way you want.

The FFC40 is going to be tricky to solder - it helps if you have some solder-wick to clean up any accidental bridges.

That should be everything you need to drive the display. All other components are for comms with my remote and other purposes.

I’ll post code next.

Assuming you’ve already looked at the ILI9341 library the next library is RollingGecko’s VESCUartControl here.

In the VescUart.h you will need to configure:

#define SERIALIO Serial1” to “#define SERIALIO Serial3”

Thanks,

DougM

1 Like

Ok, here’s some code. I trimmed it down to just the parts that pull the data from VESC and drive the display.

DougM

/* *************************************************************************************************
2016 Doug Metzler

DisplayOnly - drive VESC serial messages to a TFT display

************************************************************************************************* */
#include <SPI.h>
#include "ILI9341_t3.h"
#include "font_ArialBold.h"
#include "VescUart.h"

// pin defines
#define TFT_DC           9
#define TFT_CS          10
#define TFT_RST         22
#define TFT_Backlight   21

ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC, TFT_RST);
struct bldcMeasure measuredValues;

void setup() 
{
  pinMode(TFT_Backlight, OUTPUT);
  analogWrite(TFT_Backlight, 0);  // full bright
  
  Serial3.begin(115200);  // VESC

  // splash screen
  tft.begin();
  tft.fillScreen(ILI9341_BLUE);
  tft.setTextColor(ILI9341_YELLOW);
  tft.setRotation(4);
  tft.setFont(Arial_24_Bold);
  tft.setCursor(5,20);
  tft.print("eLongboard");
  tft.setCursor(5,60);  
  tft.print("0.1");
  tft.setCursor(5,100);  
  delay(5000);

  // operating screen
  tft.fillScreen(ILI9341_BLUE);
  tft.setTextColor(ILI9341_YELLOW);
  tft.setRotation(4);
  tft.setFont(Arial_40_Bold);
  tft.setCursor(5,10);
  tft.print("V");
  tft.setCursor(5,70);  
  tft.print("I");
  tft.setCursor(5,130);  
  //tft.println("MPH");
  tft.print("R");
  tft.setCursor(5,190);  
  tft.print("AH");
  tft.setFont(Arial_12_Bold);
  tft.setCursor(5,300);
  tft.print("Power = ");
}  

void loop()
{
  if (VescUartGetValue(measuredValues)) 
  {
    tft.setFont(Arial_40_Bold);
    tft.fillRect(60, 10, 160, 41, ILI9341_BLUE);
    tft.setCursor(60,10);
    tft.print(measuredValues.inpVoltage, 2);

    tft.fillRect(60, 70, 160, 41, ILI9341_BLUE);  
    tft.setCursor(60,70);
    tft.print(measuredValues.avgMotorCurrent, 2);

    tft.fillRect(60, 130, 160, 41, ILI9341_BLUE);    
    tft.setCursor(60,130);  
    tft.print(measuredValues.rpm, DEC);

    tft.fillRect(100, 190, 160, 41, ILI9341_BLUE);
    tft.setCursor(100,190);
    tft.print(measuredValues.ampHours, 3);
  }
  tft.setFont(Arial_24_Bold);
  tft.fillRect(5, 245, 230, 50, ILI9341_RED);
  tft.setCursor(5,250);
  delay(1000);
}
1 Like

I was thinking about achieving a similar idea, but maybe with even more potential for improvement by using a Raspberry Pi and essentialy making it into a small tablet using this kit. From there you could code in these same parameters or just install/code some sort of simple app to track them, you could download BDLC to change settings right from the board etc…

Here is the whole tutorial for the 7 inch display. I think it’s a perfect, simple solution that offers a lot of function for a reasonable price.