Monday, March 2, 2020

New Digital Dashboard

New Dashboard

It was time to upgrade the Digital Dashboard.  Here is a quick summary and a few fixes

1) New DUE Arduino controller
2) New Serial CANBUS from Longan Labs  http://docs.longan-labs.cc/can_bus/ 
3) Sainsmart 7 inch TFT LCD with CTE Shield (uses SSD1963 controller)
4) Using the UTFT and URTouch library for the display

Setup

1) UTFT myGLCD(20, 25, 26, 27, 28);  //Setup for display  This is CTE70=20
2) URTouch  myTouch( 6, 5, 32, 3, 2);  // the 32 was a change from the default 4
     - Touch Calibration worked with #define TOUCH_ORIENTATION  LANDSCAPE
3) Serial CANBUS connected to Serial 3 on the DUE  (tx-rx rx-tx)
4) 12V DC supply to the DUE (see below for 3.3v fix)

Fixes

  • TFT display would not consistently initialize after being powered off for longer than a few seconds
    1.  Added a 9K resistor as shown in http://www.dimdim.gr/2016/03/fixing-startup-issues-with-arduino-dues/
    2.  Used the latest UTFT library and un-commented out all of the unused configs in the memorysaver.h - 
    3. Removed the 3.3v supply from the DUE to the TFT Shield by bending header pin outward.  This solved the cold-start startup problem.  It seems like the 3.3v suppliers (one on the TFT shield and the one on the DUE may have been fighting each-other.

Now the system consistently boots in less than 1 second.

  •  Serial Can Bus Library - Since Serial Can Arduino Master relied on SoftSerial, a global replace of "canSerial"-> to "Serial3."
  •  Add some buffer clearing since 1939 CAN Data is on the bus starting at power-up.  This floods the serial3 port on the DUE making it difficult to perform the setup.  Sending "+++" to the Serial CANBUS board, sets it to Command Mode, but if the a baud rate is unknown, then the "+++" must be sent at each of the 5 possible baud rates.   After sending the +++; flush the receive buffer then return to Data mode.
  • Change the Serial Can Bus factorySetting() routine to set the serial baud rate to 115200 and to start searching for the current baud rate at 115200 since that is most likely where the board is set to at power up.  The Serial CanBus board stores all settings in nonvolatile memory.   Also set all 6 filters to EXT 0 and the two masks to EXT 0.  EXT is for extended frames used in J1939 CAN Bus 2.0b broadcast protocol.  The 0x00 filter and masks allow all frames to pass through.  When set right the Receive LED on the Serial Can Bus board will flicker dimly with traffic.  If set wrong, it will either be bright or off.  Also, the Green power LED flickers with serial traffic to the DUE.

No comments: