Difference between revisions of "MyMenu"

From Land Boards Wiki
Jump to navigation Jump to search
 
(37 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<video type="youtube">x83BNOB82Gg</video>
 +
 +
<video type="youtube">L8iNqIVPTeg</video>
 +
 
[[File:MyMenu-CCA-X3_5793-800px.jpg]]
 
[[File:MyMenu-CCA-X3_5793-800px.jpg]]
  
 
== Features ==
 
== Features ==
 +
 +
MyMenu is a self contained menu system with these features:
  
 
* 0.96" OLED
 
* 0.96" OLED
 
* Menu Pushbuttons
 
* Menu Pushbuttons
 +
** 5 Way Keypad (Up, Down, Left, Right, Select)
 
* Direction, Select buttons
 
* Direction, Select buttons
* I2C interface
+
* 2-wire I2C (VCC, GND, CLK, DATA) interface
** [http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf MCP23008] I2C Port Expander
+
** Selectable I2C address in range 0x20-0x27 (resistor install option)
 +
** Interrupt output line on button press
 +
* [http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf MCP23008] I2C Port Expander
 +
* OLED connection - mounts OLED to card and shares I2C connection to Host
 +
* 3 LEDs
 +
* 49x49mm card with (4) 4-40 mounting holes
 +
 
 +
== MCP23008 I2C Port Expander ==
 +
 
 +
[http://ww1.microchip.com/downloads/en/DeviceDoc/21919e.pdf Data Sheet]
 +
<pre>
 +
GPIO Port Map
 +
GP0 - LED D3
 +
GP1 - LED D2
 +
GP2 - LED D1
 +
GP3 - Select button 0 = pressed
 +
GP4 - Right button
 +
GP5 - Down button
 +
GP6 - Up button
 +
GP7 - Left button
 +
</pre>
 +
 
 +
== OLED Display ==
 +
 
 +
* [http://www.ebay.com/sch/i.html?_odkw=OLED+0.96+2IC&_sop=15&_from=R40%7CR40%7CR40&LH_BIN=1&LH_FS=1&_osacat=0&_from=R40&_trksid=p2045573.m570.l1313.TR0.TRC0.H0.XOLED+0.96+i2c.TRS0&_nkw=OLED+0.96+i2c&_sacat=0  On ebay...]
 +
* There are several versions
 +
* MyMenu requires
 +
** 4-pin I2C version
 +
** Rev X1-X3 requires pin Ordering VCC, GND, SCL, SDA
 +
 
 +
== I2C Connector ==
 +
 
 +
=== Rev X4 I2C Connector ===
 +
 
 +
[[file:MyMenu_I2C_REV_X4.PNG]]
 +
 
 +
The card has a 5-pin, 0.1" spacing connector. The connector has I2C connections (CLK and DATA) plus an Interrupt line.
 +
 
 +
# GND
 +
# VCC
 +
# SDA
 +
# SCL
 +
# INT
 +
 
 +
=== Rev X3 I2C Connector ===
 +
 
 +
[[file:MyMenu_I2C_REV_X3.PNG]]
 +
 
 +
* The card has a 5-pin, 0.1" spacing connector
 +
* The connector has I2C connections (CLK and DATA) plus an Interrupt line
 +
* Silkscreen is incorrect for SDA/SCL
 +
* Pinout is
 +
 
 +
# GND
 +
# VCC
 +
# SDA
 +
# SCL
 +
# INT
 +
 
 +
=== Rev X2 I2C Connector ===
 +
 
 +
[[file:MyMenu_I2C_REV_X2.PNG]]
 +
 
 +
The card has a 4-pin, 0.1" spacing connector for daisy-chaining. The connector has I2C connections (CLK and DATA).
 +
 
 +
# GND
 +
# VCC
 +
# SDA
 +
# SCL
 +
 
 +
=== Rev X1 I2C Connector ===
 +
 
 +
[[file:MyMenu_I2C_REV_X1.PNG]]
 +
 
 +
The card has a 4-pin, 0.1" spacing connector for daisy-chaining. The connector has I2C connections (CLK and DATA).
 +
 
 +
# GND
 +
# VCC
 +
# SDA
 +
# SCL
 +
 
 +
== Arduino Libraries ==
 +
 
 +
* The Display library is decoupled from the MyMenu library and requires a separate install
 +
 
 +
=== MyMenu Card Library/Examples ===
 +
 
 +
* [https://github.com/douggilliland/lb-Arduino-Code/tree/master/libraries/LandBoards_MyMenu MyMenu library on GitHub]
 +
** Can download the ZIP file and use the ZIP library installer
 +
* Card requires the Arduino Adafruit MCP23008 library
 +
** Needs to be installed separately from the MyMenu library
 +
** MCP23008 is the I2C interface chip that communicates with the buttons and LEDs
 +
** Tested with Adafruit MCP23008 library version 1.0.1
 +
** Driver is used to talk to the buttons/LEDs on the MyMenu card
 +
** Driver can be installed from the Arduino IDE - search "Adafruit MCP23008"
 +
* [https://github.com/douggilliland/lb-Arduino-Code/tree/master/libraries/LandBoards_MyMenu/examples MyMenu card example code]
 +
 
 +
=== Display Library - V2 Version ===
  
== Driver/Example code ==
+
* V3 Version uses Oli Kraus' u8x8 library (part of u8g2 library)
 +
* [https://github.com/olikraus/u8g2 Oli Kraus' u8g2 OLED library]
 +
* Library can be installed through Arduino IDE
 +
* Optional [https://github.com/douggilliland/lb-Arduino-Code/tree/master/libraries/LandBoards_MyMenu/examples/OLEDMenuCodeV2 Land Board Menu System Code for OLED Displays] - uses u8g2
 +
** Sketch uses 8,354 bytes (25%) of program storage space. Maximum is 32,256 bytes.
 +
** Global variables use 780 bytes (38%) of dynamic memory, leaving 1,268 bytes for local variables. Maximum is 2,048 bytes.
 +
 
 +
=== Display Library - Older Version (Deprecated) ===
 +
 
 +
* [https://github.com/olikraus/u8glib Oli Kraus' u8glib OLED library] or
 +
* Library can be installed through Arduino IDE
 +
* Optional [https://github.com/douggilliland/lb-Arduino-Code/tree/master/libraries/LandBoards_MyMenu/examples/OLEDMenuCode Land Board Menu System Code for OLED Displays] - uses u8glib
 +
* Sketch uses 10,958 bytes (33%) of program storage space. Maximum is 32,256 bytes.
 +
* Global variables use 682 bytes (33%) of dynamic memory, leaving 1,366 bytes for local variables. Maximum is 2,048 bytes.
 +
 
 +
=== Other libraries - Not Recommended for New Designs ===
 +
 
 +
* [https://github.com/adafruit/Adafruit_SSD1306 Adafruit OLED library]
 +
* [https://github.com/adafruit/Adafruit-GFX-Library Also requires Adafruit-GFX-Library]
 +
* [http://www.adafruit.com/products/326 Adafruit 0.96" OLED]
 +
 
 +
=== Driver/Example code ===
  
 
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/libraries/LandBoards_MyMenu Github Arduino Driver code]
 
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/libraries/LandBoards_MyMenu Github Arduino Driver code]
 
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/MyMenu Github Arduino Example code]
 
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/MyMenu Github Arduino Example code]
 +
 +
== Revision History/Checkout Notes ==
 +
 +
=== X4 Version Changes ===
 +
 +
* Same netlist
 +
* Fixes I2C silkscreen issues from X3
 +
 +
[[File:MyMenu-CAD-I2C-X4.PNG]]
 +
 +
=== X3 Version Changes ===
 +
 +
* Added a second I2C port for daisy chain of Host I2C
 +
* Changed host I2C pinout to G/V/SDA/SCK/INT*
 +
** Silkscreen is wrong
 +
** Board actually matches Sensor Shield SCK/SDA order
 +
* Added selection resistors R10/R11 (Vcc) and R20/R21 (GND) for OLED power/ground pins
 +
* OLEDS cards have varying pinouts, install leave open resistors to match OLED card used
 +
** OLED card pin 1 = Vcc case
 +
*** Install R10, R21 = 0 ohms for pin 1 = VCC, pin 2 = GND
 +
*** R11, R20 left open
 +
** OLED card pin 1 = GND case for pin 1 = GND, pin 2 = VCC
 +
*** Install R11, R20 = 0 ohms for pin 1 = GND case
 +
*** R10, R21 left open
 +
* Added silkscreen for MCP23008 address marking 0x2_
 +
* Reordered reference designators for easier assembly
 +
 +
[[File:MyMenu-CAD-Layout-X3.PNG]]
 +
 +
=== X2 Version Changes ===
 +
 +
* Moved LEDs to the top of the board
 +
* Created OLED module and moved mtg holes
 +
* Moved keys right
 +
 +
==== Timing ====
 +
 +
* Clock on top, data on bottom
 +
* 400 KHz
 +
 +
[[File:MyMenu-400KHz-I2C.png]]
 +
 +
* Clock/data relative timing
 +
 +
[[File:MyMenu-I2C-CLK-SDA.png]]
 +
 +
* Clock rise time
 +
 +
[[File:MyMenu-I2C-CLK-rise.png]]
 +
 +
* Clock fall timing
 +
 +
[[File:MyMenu-I2C-CLK-fall.png]]
  
 
== Parts List ==
 
== Parts List ==
  
 +
* [[MyMenu Rev X4 Assembly Sheet]]
 
* [[MyMenu Assembly Sheet]]
 
* [[MyMenu Assembly Sheet]]

Latest revision as of 19:30, 6 June 2022

MyMenu-CCA-X3 5793-800px.jpg

Features

MyMenu is a self contained menu system with these features:

  • 0.96" OLED
  • Menu Pushbuttons
    • 5 Way Keypad (Up, Down, Left, Right, Select)
  • Direction, Select buttons
  • 2-wire I2C (VCC, GND, CLK, DATA) interface
    • Selectable I2C address in range 0x20-0x27 (resistor install option)
    • Interrupt output line on button press
  • MCP23008 I2C Port Expander
  • OLED connection - mounts OLED to card and shares I2C connection to Host
  • 3 LEDs
  • 49x49mm card with (4) 4-40 mounting holes

MCP23008 I2C Port Expander

Data Sheet

GPIO Port Map
GP0 - LED D3
GP1 - LED D2
GP2 - LED D1
GP3 - Select button 0 = pressed
GP4 - Right button
GP5 - Down button
GP6 - Up button
GP7 - Left button

OLED Display

  • On ebay...
  • There are several versions
  • MyMenu requires
    • 4-pin I2C version
    • Rev X1-X3 requires pin Ordering VCC, GND, SCL, SDA

I2C Connector

Rev X4 I2C Connector

MyMenu I2C REV X4.PNG

The card has a 5-pin, 0.1" spacing connector. The connector has I2C connections (CLK and DATA) plus an Interrupt line.

  1. GND
  2. VCC
  3. SDA
  4. SCL
  5. INT

Rev X3 I2C Connector

MyMenu I2C REV X3.PNG

  • The card has a 5-pin, 0.1" spacing connector
  • The connector has I2C connections (CLK and DATA) plus an Interrupt line
  • Silkscreen is incorrect for SDA/SCL
  • Pinout is
  1. GND
  2. VCC
  3. SDA
  4. SCL
  5. INT

Rev X2 I2C Connector

MyMenu I2C REV X2.PNG

The card has a 4-pin, 0.1" spacing connector for daisy-chaining. The connector has I2C connections (CLK and DATA).

  1. GND
  2. VCC
  3. SDA
  4. SCL

Rev X1 I2C Connector

MyMenu I2C REV X1.PNG

The card has a 4-pin, 0.1" spacing connector for daisy-chaining. The connector has I2C connections (CLK and DATA).

  1. GND
  2. VCC
  3. SDA
  4. SCL

Arduino Libraries

  • The Display library is decoupled from the MyMenu library and requires a separate install

MyMenu Card Library/Examples

  • MyMenu library on GitHub
    • Can download the ZIP file and use the ZIP library installer
  • Card requires the Arduino Adafruit MCP23008 library
    • Needs to be installed separately from the MyMenu library
    • MCP23008 is the I2C interface chip that communicates with the buttons and LEDs
    • Tested with Adafruit MCP23008 library version 1.0.1
    • Driver is used to talk to the buttons/LEDs on the MyMenu card
    • Driver can be installed from the Arduino IDE - search "Adafruit MCP23008"
  • MyMenu card example code

Display Library - V2 Version

  • V3 Version uses Oli Kraus' u8x8 library (part of u8g2 library)
  • Oli Kraus' u8g2 OLED library
  • Library can be installed through Arduino IDE
  • Optional Land Board Menu System Code for OLED Displays - uses u8g2
    • Sketch uses 8,354 bytes (25%) of program storage space. Maximum is 32,256 bytes.
    • Global variables use 780 bytes (38%) of dynamic memory, leaving 1,268 bytes for local variables. Maximum is 2,048 bytes.

Display Library - Older Version (Deprecated)

Other libraries - Not Recommended for New Designs

Driver/Example code

Revision History/Checkout Notes

X4 Version Changes

  • Same netlist
  • Fixes I2C silkscreen issues from X3

MyMenu-CAD-I2C-X4.PNG

X3 Version Changes

  • Added a second I2C port for daisy chain of Host I2C
  • Changed host I2C pinout to G/V/SDA/SCK/INT*
    • Silkscreen is wrong
    • Board actually matches Sensor Shield SCK/SDA order
  • Added selection resistors R10/R11 (Vcc) and R20/R21 (GND) for OLED power/ground pins
  • OLEDS cards have varying pinouts, install leave open resistors to match OLED card used
    • OLED card pin 1 = Vcc case
      • Install R10, R21 = 0 ohms for pin 1 = VCC, pin 2 = GND
      • R11, R20 left open
    • OLED card pin 1 = GND case for pin 1 = GND, pin 2 = VCC
      • Install R11, R20 = 0 ohms for pin 1 = GND case
      • R10, R21 left open
  • Added silkscreen for MCP23008 address marking 0x2_
  • Reordered reference designators for easier assembly

MyMenu-CAD-Layout-X3.PNG

X2 Version Changes

  • Moved LEDs to the top of the board
  • Created OLED module and moved mtg holes
  • Moved keys right

Timing

  • Clock on top, data on bottom
  • 400 KHz

MyMenu-400KHz-I2C.png

  • Clock/data relative timing

MyMenu-I2C-CLK-SDA.png

  • Clock rise time

MyMenu-I2C-CLK-rise.png

  • Clock fall timing

MyMenu-I2C-CLK-fall.png

Parts List