Overblog Suivre ce blog
Editer la page Administration Créer mon blog
Xtase & Androids

Arduino HUI (subproject)

UI module
UI module

Hi, here's my matest subproject : my Arduino UI module (an I/O header substytem for the Arduino Yun or a computer or any connected stuff that you want)

It provides an analogic Joystick, an LCD panel, a TV-Out and is driven by a low cost AT328P (an Arduino Pro Mini 3.3v 8MHz)

* The Joystick is a casual 2 ways analog potentiometers made

* the LCD panel is 128x64 monochrome model

* the TVOut is 48x36 monochrome display

Arduino HUI (subproject)

The first idea was to use the ProMini as a video adapter for any kind of electronic serial stuff...

Finally it does provides a full I/O controller.

the MCU is programmed with an u8glib modified 'Console' sample, an AnalogRead routine used to read the 2 potentiometers of the Joystick

As it uses TvOut Lib -> it works directly with Serial I/O instead of SoftwareSerial to deal w/ external Arduino or computer.

The 15KR is used to allow RX to receive 5v level TX (other/external arduino contoller)

LCD pinout
LCD pinout

The LCD panel is driven by an LCD ST7920 chip, & must be used as U8GLIB_ST7920_128X64_4X w/ the U8GLib for Arduino.

After wiring as on the picture, you should be able to lead your display w/ only 4 wires instead of 20 pins.

The endpoint connector
The endpoint connector

The endpoint connector is now brushed on a legacy DB9 :

it can support the Vcc/TX/RX/GND/RES signals & the new integrated USB hub too.

Yes there's now an USB hub in order to embed the sound dungle & a free USB host for an external keyboard or other device...

The Module Protocol :

0xA0 // LCD re-init OpCode

0XA1 - x - y // locate cursor

0xA2 - bytes[] - 0x00 // drawString

0xA3 - 0x01 // clear screen

0xAA // draw a shape (use another sub protocol)

0xAB // request for joystick reading (writes back 2 bytes w/ X & Y axis value [0..255])

The drawing sub protocol

0xAA // draw a shape (use another sub protocol)

[0..255] shape index

shapeType [0..4]

x [0..128]

y [0..64]

w // width or radius for circle
h // height
rad // radius for rounded rect
shapeFilled [0..1]

GUI sample

GUI sample

The graphical system is able to draw up to 256 distinct shapes,

these are directly stored on the 328P MCU (and uses 256 * 7 bytes of RAM)

#define SHAPE_TYPE_RECT 0x01
#define SHAPE_TYPE_CIRCLE 0x02
#define SHAPE_TYPE_RRECT 0x03
#define SHAPE_TYPE_LINE 0x04
#define SHAPE_TYPE_NONE 0x00

as the HUI was designed to be a video adapter, the external master device (as my Arduino Yun core) don't have to care about handling the display & storage of these shapes.

Partager cette page

Repost 0