Our new official repo is on github
LCD Smartie version 5.6 is released!
Download it now: https://github.com/LCD-Smartie/LCDSmartie/releases

LCD Smartie and SSD1311 chipset

General discussion about LCD Smartie.

Moderators: _X7JAY7X_, caesar, IFR, mattcro, limbo, Fast351

Post Reply
xpsd300

LCD Smartie and SSD1311 chipset

Post by xpsd300 »

Hello,

I'm looking for a 20x2 OLED/VFD module for an upcoming Windows 7 HTPC build that is compatible with LCD Smartie.

The only modules I could find that would fit the chassis (Morex 887, 36mm outer height) are from the manufacturer WIDE.hk, such as part # W2202OL.

The outer dimensions of this module are 96 x 19 x 6mm (w x h x d) and the character size is approximately 3.4 x 5.1mm (w x h).

Has anyone used this brand of module with LCD Smartie?

It has a Solomon Systech SSD1311 chipset. It also has an I2C interface rated 90-110 mA @ 3.3V/5.0V, so I would be using a USB-to-I2C adapter to connect it to the motherboard (Asus Q87T thin mini-ITX).

Thanks.

hurley
Posts: 46
Joined: May 26th, 2011, 8:03 am

Re: LCD Smartie and SSD1311 chipset

Post by hurley »

Uncanny timing there xpsd300.
I have that exact OLED module and just in the process of polishing up an Arduino sketch to run it along with a few other things like Ir for remote boot up, system fan control and a bunch of other stuff...

It looks great, vastly better than LCD and very compact.
My HTPC's built into a slim DVD player case so its only about 30mm high too.

The codes a combination of a modified matrix orbital sketch that Dave Perrow posted for LCD's on Arduino and bits from wide.hk's sample code with tweaks from the SSD1311 datasheet.
It's a bit messy at the moment but I've got most features working like custom characters and got the I2C running at 400Kbs.
Happy to pass it on when it's tidied up.

I can thoroughly recommend that OLED module.
(It's even got some useful HTPC centric characters in the rom table.)

hurley.
Last edited by hurley on May 28th, 2014, 3:31 am, edited 1 time in total.

xpsd300

Re: LCD Smartie and SSD1311 chipset

Post by xpsd300 »

@hurley Thanks for the feedback.

Are you using your Arduino just as a USB-to-I2C adapter, or is it running your entire HTPC?

Also, will your sketch work with Windows Media Center?

hurley
Posts: 46
Joined: May 26th, 2011, 8:03 am

Re: LCD Smartie and SSD1311 chipset

Post by hurley »

Sorry, haven't forgotten about this, just working on the code.
I'll post it up here when it's ready.

The Arduino just presents as a com port (via usb) to the computer so it takes the commands and data sent from matrix.dll and translates them onto the I2C bus.
So from the pc's perspective (and any LCD Smartie plugins/WMC) the OLED is just like a matrix orbital serial LCD screen.

As for the extras, just getting my $3 worth out of the Arduino.
The I2C/Screen stuff only takes up 2 data pins and a portion of code space so why not.
One major benefit is since the Arduino runs when the pc's hibernated, it can decode the ir for the remotes power button, display a clock, maybe even list the upcoming schedules for MediaPortal... Limited by your imagination really.

Anyway, back to work..
hurley.

xpsd300
Posts: 4
Joined: May 19th, 2014, 11:04 pm

Re: LCD Smartie and SSD1311 chipset

Post by xpsd300 »

Thanks for letting me know the wide.hk display is compatible with the Matrix Orbital drivers used by LCD Smartie. I couldn't get a definitive answer from either vendor. Do you know if the brightness can be adjusted since it is not a true HD44780 chipset?

Also, for clarification, would it be possible to program the Arduino to control the display while the HTPC is in a sleep state, and then have LCD Smartie take over control of the display when Windows is in use? I'd like to display a clock at reduced brightness when the PC is in a sleep state, and then display Windows Media Center statuses at full brightness once Windows boots up.

Finally, wondering if I can re-use the IR Receiver from the Morex 887 case (CIR header, RC6 compatible) via the Arduino. I had originally planned on buying an internal USB one from Inteset, but if I can re-use the Morex one with the Arduino and have it detected as an RC6 IR Receiver by Windows Media Center, that would be ideal.

hurley
Posts: 46
Joined: May 26th, 2011, 8:03 am

Re: LCD Smartie and SSD1311 chipset

Post by hurley »

Brightness is adjustable.
I've linked it up to LCD Smarties brightness slider in the code, but later I'd like to tie in the light dependent resistor in my front panel to one of the Arduino's analog pins and have it auto adjust to the room light level.
Actually I was surprised to find the brightness level only ranges from about 50% - 100%.
I'd assumed it would go down to zero, but it's fairly subtle at it's lowest setting.

As long as you power it from 5VSB it'll run independent of the pc and when LCD Smartie starts up and sends data it'll take over.
If that's whats programmed in.
You will probably need to monitor the 5V rail or PWR_OK pin of your PSU on one of Arduino's digital pins to reliably determine power state.
There's a boolean value smartieRunning in the sketch but a hardware solution would be better.

For the standby clock you'll need an RTC module. I think the common ones you see on eBay run on I2C so you can just piggy back it onto the same I2C bus.
And a little code to synchronise the time with your pc every now and then.
At that point you'll have to jostle over the serial port with LCD Smartie.
Maybe write a script to close smartie, update time, restart smartie.. on resume or set up a second serial port on spare digital pins on the Arduino.

I'm not sure how OLED's go with burn in, might be ok to just shift the clock digits around periodically.

How bout a nice animated boot screen too, I've got some graphics lined up for a MePo one..
Everything's possible, just takes a bit of learnin time, fun tho.

On IR, if the case comes with a plug n play remote (looks like it does from the pictures) I'd stick with that or if not just get a usb MCE style remote.
They usually work as HID keyboard/mouse combo, and don't need any software like Girder or HiP.

Just power the receiver from 5VSB and tie the output pin of the receiver diode to a digital pin on Arduino, or if it's easier stick another dedicated diode next to it.
Then use the boolean state of your power monitoring pin to route to some ir decoding functions in the loop part of the sketch.
That way the Arduino only takes over ir decoding when the pc's off.

There's a nice IRDecoding Library here: http://www.righto.com/2009/08/multi-pro ... brary.html

I've been playing around with that and it's pretty easy to get set up.

Jeez I'm rambling...
Anyway most of this stuff I plan on doing too so I don't mind sharing and helping out. But I'm new to Arduino so have a learning curve to work through.

hurley
Posts: 46
Joined: May 26th, 2011, 8:03 am

Re: LCD Smartie and SSD1311 chipset

Post by hurley »

This is an incomplete but functional sketch for the SSD1311 OLED on LCD Smartie.

It only supports I2C interface and 2 line displays at the moment but I'd like to make it into a proper universal library.
Just need to learn how to make a library with a nested library inside it (Wire.h for I2C).
If any Arduino guru's can help with that it would be much appreciated.

Details:
BAUD RATE: I've set default to 115200 but tested to work up to 1000000 (yes 1Mbaud) just match the setting in Smartie to what ever you choose for the sketch.

CGROM TABLES: Can be selected by typing into Screen Settings $Chr(254)#ROMA or $Chr(254)#ROMB or $Chr(254)#ROMC you'll get a CGROM-X SET message returned to the screen.

BRIGHTNESS: Setting is linked to Smarties brightness slider and gets saved to EEPROM if changed when Smartie closes.

There's one annoying issue which is a feature of Arduino's and that is that they reset when anything connects via serial port.
This usually causes the first batch of data sent to the screen when you start LCD Smartie to get corrupted.
It clears up when Smartie changes to the next screen or updates the first.
(Doesn't affect Arduino Micro/Leonardo)

I've added some work-around code which half fixes this.
Should display a waiting... message if it can't extract the text from the serial buffer, which is better than garbage characters.
But the only real solution is to use an external usb-serial adapter or a hardware mod to stop the reset on connect behavior.

It's a work in progress so will likely get updated in due course.
And thanks go to Dave Perrow for providing the matrix orbital translation code that this is partially based on.

Smartie_SSD1311_I2C.ino...seam's I cant post an attachment here, hope it fits ok in code tags:

Code: Select all

//***********************************************************************//
//    Arduino sketch for LCD Smartie and SSD1311 OLED in I2C Mode        //
//    ####  2014-05-24  Author: hurley @ LCD Smartie forum   ####        //
//      -------------------------------------------------------          //
//  This really needs parting out to a universal library for the         //
//  SSD1311 display code, but it's a work in progress...                 //
//                                                                       //
//  Sources:                                                             //
//  SSD1311 Init routines > wide.hk sample code and SSD1311 Datasheet.   //
//  LiquidCrystal Library > Tried to replicate this generic LCD library  //
//  for the functions applicable to SSD1311 controlled OLED screens.     //
//  Matrix Orbital Code > Derived from code supplied by Dave Perrow @    //
//  LCD Smartie forum, for running generic HD44780 LCD's on Arduino      //
//  using matrix.dll as a display driver.                                //
//                                                                       //
//  - Some tweaking may still be req'd particularly in relation to       //
//    delays for sending commands / data.                                //
//  - Arduino's default behaviour when using it's on-board serial port   //
//    is to reset on serial connect. This results in truncated data or   //
//    serial buffer overflows when LCD Smartie first starts and may      //
//    cause the first screen that Smartie displays to either not update  //
//    or display unexpected results. (This clears when Smartie changes   //
//    to the next screen or updates the current screen).                 //
//     [27/5 Work-around code added to make this less annoying]          //
//                                                                       //
//    The elegant solution to this is to disable 'reset on connect'      //
//    with a hardware mod (google) or use an external serial adapter     //
//    to pins 0/1. (Micro/Leonardo not affected by this issue).          //
//    Increasing the serial buffer size to 256 bytes (Follow this        //
//    guide: http://www.hobbytronics.co.uk/arduino-serial-buffer-size )  //
//    should alleviate the buffer overflow side of this issue.           //
//     [But at the cost of more SRAM being wasted]                       //
//    Note: Full start sequence from LCD Smarties matrix.dll display     //
//    driver is 135 bytes + 4 bytes per row + 1 byte per character.      //
//     [ie: 183 bytes for 20x2 screen]                                   //
//                                                                       //
//  -- Released to the public domain. --                                 //
//***********************************************************************//

//=======================================================================//
//   WARNING NOTE: matrix.dll tries to process any inputs from the       //
//   serial port as button presses from Maxtrix Orbital hardware.        //
//   Ensure to comment out any debug messages to Serial.println /        //
//   Serial.print as these may cause issues with LCD Smartie.            //
//=======================================================================//


#include <Arduino.h>
#include <Wire.h>                               // required for I2C
#include <EEPROM.h>                             // required to store settings
#include <avr/pgmspace.h>                       // required to use PROGMEM (Flash memory)

// CGROM Tables                                 // CGROM Table can be selected by typing:
#define CGROM_A 0x01                            // $Chr(254)#ROMA or $Chr(254)#ROMB or $Chr(254)#ROMC
#define CGROM_B 0x05                            // into LCD Smarties Screen Settings.
#define CGROM_C 0x09                            // This setting is saved to EEPROM and restored on power reset.

// EEPROM Addresses                             // For storing persistant settings
#define MEM_ADDRESS_ACTIVE_ROM 0
#define MEM_ADDRESS_BRIGHTNESS 1

// I2C
#define I2C_ADDRESS 0x3C
#define I2C_BITRATE_100 72
#define I2C_BITRATE_400 12                      // Use TWBR to set I2C bitrate

// Mode
#define OLED_COMMAND_MODE 0x80
#define OLED_DATA_MODE 0x40

// CommandSet
#define OLED_CMDSET_RE_1 0x2A                   // Extended Command Set [00101010]
#define OLED_CMDSET_RE_0 0x28                   // Disable              [00101000]
#define OLED_CMDSET_SD_1 0x79                   // OLED Command Set     [01111001]
#define OLED_CMDSET_SD_0 0x78                   // Disable              [01111000]

// Commands
#define OLED_CLEARDISPLAY 0x01
#define OLED_RETURNHOME 0x02
#define OLED_ENTRYMODESET 0x04
#define OLED_DISPLAYCONTROL 0x08
#define OLED_CURSORSHIFT 0x10
#define OLED_SETCGRAMADDR 0x40
#define OLED_SETDDRAMADDR 0x80
#define OLED_SETCONTRAST 0x81
#define OLED_SETCGROM 0x72

// Flags for display entry mode
#define OLED_ENTRYRIGHT 0x02
#define OLED_ENTRYLEFT 0x00
#define OLED_ENTRYSHIFTDISPLAY 0x01
#define OLED_ENTRYSHIFTCURSOR 0x00

// Flags for display on/off control
#define OLED_DISPLAYON 0x04
#define OLED_DISPLAYOFF 0x00
#define OLED_CURSORON 0x02
#define OLED_CURSOROFF 0x00
#define OLED_BLINKON 0x01
#define OLED_BLINKOFF 0x00

// Flags for display/cursor shift
#define OLED_DISPLAYMOVE 0x08
#define OLED_CURSORMOVE 0x00
#define OLED_MOVERIGHT 0x04
#define OLED_MOVELEFT 0x00

// PROGMEM - (Allocated to Flash Memory)
// Mapping Table: Re-maps incorrectly placed characters in ROM-A relative to ASCii standard.
// ROM-B is correctly mapped for range 32-126. 
// ROM-C displaces [BACKSLASH with YEN] and [TILDE with RIGHT ARROW]..
// ..but has no CGRAM space so don't bother with remapping.
//-------------------------------------------------------------------------
#define MAP_SIZE_ROM_A 28
PROGMEM prog_uchar charMap_A[MAP_SIZE_ROM_A] = {
  // Only re-map characters in the ASCii Printable range 32-126
  // There are just too many variations of codepages for the Extended range!
  0x24, 0xA2, // "$" (36 -> 162)
  0x40, 0xA0, // "@" (64 -> 160)
  0x5B, 0xFA, // "[" (91 -> 250)
  0x5C, 0xFB, // "\" (92 -> 251)
  0x5D, 0xFC, // "]" (93 -> 252)
  0x5E, 0x1D, // "^" (94 -> 29)
  0x5F, 0xC4, // "_" (95 -> 196)
  0x60, 0x27, // "`" (96 -> 39) not in table map to "'"
  0x7B, 0xFD, // "{" (123 -> 253)
  0x7C, 0xFE, // "|" (124 -> 254)
  0x7D, 0xFF, // "}" (125 -> 255)
  0x7E, 0xCE, // "~" (126 -> 206)
  0xA3, 0xA1, // "£" (163 -> 161)
  0xA5, 0xA3  // "¥" (165 -> 163)
};


//=======================================================================================================
// Setup Defaults
//=======================================================================================================

#define COLS 20                                 // Setup Screen Size (columns/rows)
#define ROWS 2
#define SERIAL_BUFFER_SIZE 64                   // If you modify the buffer size in Serial Library change this value as well..
                                                // ..(Keep in mind that the buffer uses up valuable SRAM)
// Variables
boolean debug = false;                          // Debugging: Is set to true to input ASCii HEX values via Serial Monitor.
uint8_t cgromTable = CGROM_A;                   // Default CGROM: [CGROM_A / CGROM_B / CGROM_C]
uint8_t brightness = 0xFF; // FULL              // Default Brightness: [100%/255 = 0xFF] (Range: 0-255 [0x00-0xFF])
                                                // ** The value of LCD Smarties brightness slider is stored to EEPROM..
uint8_t _displaycontrol;                        // ..when LCD Smartie closes but only if value has changed from stored.
uint8_t _displaymode;
boolean smartieRunning = false;


//=======================================================================================================
// Setup / Loop (MAIN FUNCTIONS)
//=======================================================================================================

void setup()                                                    // Setup code called at power up or reset
{
  loadSettings();                                               // Load stored settings from EEPROM

  Serial.begin(115200); // 9600 115200 1000000                  // Open serial communications ** Up to 2000000 baud rate
                                                                // NOTE: Set baud to 9600 for uploads/debugging.
  //oledBegin(COLS, ROWS);                                      // Default I2C bitrate [100 Kb/s] ..OR..
  oledBegin(COLS, ROWS, I2C_BITRATE_400);                       // Specify I2C bitrate max [400 Kb/s]
  
  //------------------------------------------------------      // Start-Up Message. Change/comment out as required.
  sendString("LCD SMARTIE OLED I2C");                           
  setCursor(7, 1);                                              // col, row (zero based)
  sendString("STARTUP");
  //------------------------------------------------------
  
  // Work-around for reset on connect
  if (Serial.available() > 0) { resetOnConnectHandler(); }      // Buffer contains data that we've missed during a 'Reset On Connect'
}

void loop()                                                     // Main program continually called till power off
{
  if (Serial.available() > 0)                                   // Check for commands from the serial port
  { 
    uint8_t c = 0;
    c = Serial.read();
    processInput(c);
  }
  //delay(5); TODO: Use non blocking millis(); counter here if delay is required
}


//=======================================================================================================
// Translate Matrix Orbital Commands
//=======================================================================================================

void processInput(uint8_t c)                                    // Translate Matrix Orbital Commands
{ 
  uint8_t rxbyte = c;
  uint8_t i;
  uint8_t chars[8];
  uint8_t num;

  #define CASE break; case
  
  // Un-comment this section to enable ASCii input using 'Serial Monitor' by
  // typing the HEX values of commands or characters using the format: "[FE 47 01 00]"
  //----------------------------------------------------------------------------------------------------
  //if (rxbyte == '[')                                          // Flags beginning of debug input string
  //{ 
  //  debug = true;                                             // set ascii mode
  //  rxbyte = nextb();                                         // read the next byte
  //}
  //else debug = false;                                         // else we are in binary mode
  //----------------------------------------------------------------------------------------------------
  
  if (rxbyte == 0xFE)                                           // Matrix Orbital uses 0xFE(254) prefix for Commands
  { 
    while (rxbyte == 0xFE) { rxbyte = nextb(); }                // Ignore multiple 0xFE's
    switch (rxbyte) 
    { 
      CASE 0:                                                   // Ignore NULL BYTE
      CASE 0x23:                      // "#"                    // Set CGROM Table (Format: cmd byte 0xFE + #ROMX where X = A, B or C)
                 if (nextb() == 0x52  // "R"                    // ..Example type: $Chr(254)#ROMB in LCD Smartie screen settings.
                  && nextb() == 0x4F  // "O"
                  && nextb() == 0x4D) // "M"
                   setCGROM(nextb()); // "A"/"B"/"C"
                   saveSettings();                              // Save Selected CGROM ID to EEPROM (will be loaded after power reset)
      CASE 0x42: nextb(); // [Dispose duration parameter]       // [IGNORED] Set Backlight ON (param: duration(minutes))
      CASE 0x46: if (isSmartieShutdown()) saveSettings();       // Set Backlight OFF [Called by matrix.dll Destroy()]..
                                                                // ..We use this to test for LCD Smartie Shutdown.
      CASE 0x47: setCursor(nextb()-1,nextb()-1);                // Set Cursor Position (params: col, row)
                 if (!smartieRunning)                           // ..We use this command to confirm LCD Smartie has started.
                 { clear(); smartieRunning = true; }            // ..Clear screen incase 'waiting...' message is displayed.
      CASE 0x48: home();                                        // Cursor Home (move to column 1, row 1)
      CASE 0x4A: cursorOn();                                    // Underline Cursor ON
      CASE 0x4B: cursorOff();                                   // Underline Cursor OFF
      CASE 0x4C: shiftCursorLeft();                             // Move Cursor Left
      CASE 0x4D: shiftCursorRight();                            // Move Cursor Right
      CASE 0x4E: num = nextb();                                 // Create Custom Character (params: char number, 8x char rows)
                 for (i = 0; i < 8; i++) chars[i] = nextb();
                   createChar(num, chars);
      CASE 0x50: nextb(); // [Dispose value parameter]          // [IGNORED] Set Contrast (param: value(0-255))
      CASE 0X51: autoscrollOn();                                // Auto Scroll ON
      CASE 0X52: autoscrollOff();                               // Auto Scroll OFF
      CASE 0x53: blinkOn();                                     // Blinking Block Cursor ON
      CASE 0x54: blinkOff();                                    // Blinking Block Cursor OFF [Called by matrix.dll initLCD()]
      CASE 0X56: nextb(); // [Dispose gpo number parameter]     // [IGNORED] General Purpose Output OFF (param: GPO number)
      CASE 0X57: nextb(); // [Dispose gpo number parameter]     // [IGNORED] General Purpose Output ON (param: GPO number)
                                                                //  **Can use GPO functions with Smartie Actions to set digital pins on/off.
      CASE 0x58: clear();                                       // Clear Display, Cursor Home
      CASE 0x5B: cursorOff();                                   // Cursor OFF
      CASE 0x91: nextb(); // [Dispose value parameter]          // [IGNORED] Set and Save Contrast (param: value(0-255))
      CASE 0x98: brightness = nextb();                          // Set and Save Backlight (param: value(0-255))
                 setContrast(brightness);                       //  **Saved to EEPROM at Smartie shutdown if value changed.
      CASE 0xC0: nextb(); // [Dispose fan number parameter]     // [IGNORED] Set Fans 1-3, speed 0-255 (params: fan number, fan speed)
                 nextb(); // [Dispose fan speed parameter]      //  **Can use this function with Smartie Actions to set analog pins value.
      default: break;                                           // All other commands ignored
    }
  }
  else if (rxbyte != '\n')                                      // Process character for sending to screen (ignore newline characters)
  {
    if (cgromTable == CGROM_A)                                  // Need to re-map characters in CGROM_A to correct ASCii location 
    {
      for (i = 0; i < (MAP_SIZE_ROM_A / 2); i++)
      {
        if (rxbyte == pgm_read_byte_near(charMap_A + (i * 2)))  // if map contains char..
        {
          rxbyte = pgm_read_byte_near(charMap_A + (i * 2 + 1)); // ..return it's replacement location
          break; 
        }
      }
    }
    sendData((char)rxbyte);                                     // Print the character to screen
  }
}

byte nextb()                                                    // Get the next byte
{ 
  if (debug == false) return nextch();                          // read the next byte as a byte if we are not in ascii mode
  
  byte c, d;
  c = nextch() - '0'; if (c > 9) c = c + '0' - 'A' + 10;        // read 2 digit hex as the byte
  d = nextch() - '0'; if (d > 9) d = d + '0' - 'A' + 10;        //
  nextch();                                                     // ignore , or ], or \n
  return (((c * 16) + d) & 0xff);
}

byte nextch()                                                   // Get the next character
{
  while (Serial.available() == 0) delayMicroseconds(50);        //delay(1); // Wait for the next character
  return (byte) (Serial.read() & 0xff);                         // read the incoming byte
}


//=======================================================================================================
// Load Settings from / Save Settings to EEPROM
//=======================================================================================================

void loadSettings()                                             // Load Settings from EEPROM
{
  // CGROM
  uint8_t bVal = EEPROM.read(MEM_ADDRESS_ACTIVE_ROM);           // Get stored cgromTable value (** If empty 255/0xFF is returned)
  if (bVal == CGROM_A || bVal == CGROM_B || bVal == CGROM_C)    // If returned value is valid (has previously been stored)..
  { cgromTable = bVal; }                                        // ..Apply Setting (Otherwise we use default setting from "Setup Defaults")
  
  // BRIGHTNESS
  brightness = EEPROM.read(MEM_ADDRESS_BRIGHTNESS);             // Get stored brightness value (** If empty default 255 [FULL] is returned)
}

void saveSettings()                                             // Save settings to EEPROM (100K writes limit. Use with caution)
{                                                               // ** This function will only write to EEPROM if new value..
  if (brightness != EEPROM.read(MEM_ADDRESS_BRIGHTNESS))        // ..is different from stored value.
  {
    EEPROM.write(MEM_ADDRESS_BRIGHTNESS, brightness);           // Store the brightness setting to EEPROM
    delay(5); // write takes 3.3ms
  }

  if (cgromTable != EEPROM.read(MEM_ADDRESS_ACTIVE_ROM))
  {
    EEPROM.write(MEM_ADDRESS_ACTIVE_ROM, cgromTable);            // Store the active ROM ID to EEPROM
    delay(5); // write takes 3.3ms
  }
}


//=======================================================================================================
// Utilities
//=======================================================================================================

boolean isSmartieShutdown()                                     // Test for LCD Smartie shutdown sequence
{
  // Note: 0xFE, 0x46 is sent twice at shutdown.
  // First 0xFE 0x46 gets consumed by processInput() then.. 
  // 0xFE 0x46 0xFE 0x56 0x01.. ..0xFE 0x56 0x08

  if (nextb() != 0xFE || nextb() != 0x46) return false;         // first command pair in shutdown sequence 0xFE, 0x46
  for (int i = 0; i < 8; i++)                                   // remaining cmd groups 8x 0xFE, 0x56, 0x0n (n = 1-8)
  {
    if (nextb() == 0xFE && nextb() == 0x56 && nextb() == (i + 1))
    {
      // If using LCD Smarties GPO handling and want all GPO's set
      // to off at smartie shutdown add code for digital pins here...
    }
    else { return false; }
  }

  smartieRunning = false;                                       // If we reach this point we are in shutdown sequence
  return true;
}

void resetOnConnectHandler()                                    // Handler for on-board serial causing reset on LCD Smartie start.
{                                                               // Not exactly a fix but should at least prevent garbage being..
  uint8_t c = 0;                                                // ..displayed on the screen at Smartie startup.
  boolean success = false;                                      // You can change the 'waiting..' message below as required.
  
  if (Serial.available() < (SERIAL_BUFFER_SIZE - 1)             // Serial buffer NOT overflowed
   && Serial.available() >= ((4 * ROWS) + (COLS * ROWS)))       // AND buffer contains all screen text
  {                                                             // (Last 48 bytes for 20x2 screen)
    long timeout = 1000;
    long startTime = millis();
    c = Serial.read();
    while (!(success = (c == 0xFE && Serial.peek() == 0x47)))   // Try to re-synchronise serial buffer to 'Set Cursor' Command         
    { 
      delay(2); 
      c = Serial.read();
      if (millis() > (startTime + timeout)) break;              // Make sure we dont get stuck here if command not found
    }
  }
  if (success)                                                  // Buffer synchronised to start of text and text is complete
  {
    smartieRunning = true;
    clear(); 
    processInput(c);
    while (Serial.available() > 0) processInput(Serial.read()); // Send the text to the screen
  }
  else                                                          // Unable to retrieve text to display
  {
    while (Serial.available() > 0) { Serial.read(); }           // Flush serial buffer..
    clear(); 
    sendString("Waiting for Smartie");                          // Send 'waiting...' message
    setCursor(0, 1);                                            // col, row (zero based)
    sendString(" screen refresh... ");
  }
}


//=======================================================================================================
// SSD1311 OLED (I2C) Library Functions:   --  SECTION BELOW TO BE CONVERTED TO SSD1311 LIBRARY  --
//=======================================================================================================

//***********************************************************************//
//    Arduino Library for SSD1311 Based Character OLED Displays          //
//    ####  2014-05-24  Author: hurley @ LCD Smartie forum ####          //
//      -----------------------------------------------------            //
//  This is a work in progress with lot's yet to be implemented.         //
//  Currently Supports 2 Line displays via I2C only.                     //
//                                                                       //
//  TODOs:                                                               //
//  - Convert this section to a universal Library.                       //
//  - Add 4/8 bit Parallel and SPI interface modes.                      //
//  - Add 4 Line display mode.                                           //
//  - Add 'Double Height' font modes.                                    //
//  - Add support for smoothe 'dot' scroll mode.                         //
//    ...                                                                //
//                                                                       //
//  -- Released to the public domain. --                                 //
//***********************************************************************//


void oledBegin(uint8_t _cols, uint8_t _rows)                    // Init OLED Library (Default I2C bitrate 100Kbs)
{
  // _cols / _rows Not Implemented (For 4 Line screens)
  oledBegin(_cols, _rows, I2C_BITRATE_100);
}

void oledBegin(uint8_t _cols, uint8_t _rows, uint8_t bitrate)   // Init OLED Library (Specify I2C bitrate [Max 400Kbs])
{
  // _cols / _rows Not Implemented (For 4 Line screens)
  
  Wire.begin();                                                 // Initialise I2C Library
  
  if (bitrate != I2C_BITRATE_100) TWBR = bitrate;               // Set I2C BitRate to 400Kbs (TWBR = 12)..
                                                                // ..from default 100Kbs (TWBR = 72)
  
  oledInit();                                                   // Initialise SSD1311 OLED Controller
  
  _displaycontrol =                                             // Init Display Control Defaults..
  OLED_DISPLAYON | OLED_CURSOROFF | OLED_BLINKOFF;              // ..(display ON, no cursor or blinking)
  displayOn();

  _displaymode = OLED_ENTRYRIGHT | OLED_ENTRYSHIFTCURSOR;       // Init Display Mode Defaults..
  sendCommand(OLED_ENTRYMODESET | _displaymode);                // ..(text left to right, cursor moves right)
  
  clear();                                                      // Clear Display
}

void clear()                                                    // Clear Display and set cursor position to zero.
{
  sendCommand(OLED_CLEARDISPLAY);                               // 0x01
  //delayMicroseconds(2000); // not needed
}

void home()                                                     // Cursor Home. (Reset cursor position to column 1, row 1)
{ 
  sendCommand(OLED_RETURNHOME);                                 // 0x02
  //delayMicroseconds(2000); // not needed
}

void setCursor(uint8_t col, uint8_t row)                        // Set Cursor Position. (col, row)
{
  int row_offsets[] = { 0x00, 0x40 };
  sendCommand(OLED_SETDDRAMADDR | (col + row_offsets[row]));    // 0x80, pos
}

void displayOn()                                                // Set Display ON
{
  _displaycontrol |= OLED_DISPLAYON;
  sendCommand(OLED_DISPLAYCONTROL | _displaycontrol);           // 0x08, 0x04 [0x0C / 000011**]
}

void displayOff()                                               // Set Display OFF
{
  _displaycontrol &= ~OLED_DISPLAYON;
  sendCommand(OLED_DISPLAYCONTROL | _displaycontrol);           // 0x08, -0x04 [0x08 / 000010**]
}

void cursorOn()                                                 // Set Cursor ON
{  
  _displaycontrol |= OLED_CURSORON;
  sendCommand(OLED_DISPLAYCONTROL | _displaycontrol);           // 0x08, 0x02 [00001*1*]
}

void cursorOff()                                                // Set Cursor OFF
{
  _displaycontrol &= ~OLED_CURSORON;
  sendCommand(OLED_DISPLAYCONTROL | _displaycontrol);           // 0x08, -0x02 [00001*0*]
}

void blinkOn()                                                  // Set Cursor Blink ON
{
  _displaycontrol |= OLED_BLINKON;
  sendCommand(OLED_DISPLAYCONTROL | _displaycontrol);           // 0x08, 0x01 [00001**1]
}

void blinkOff()                                                 // Set Cursor Blink OFF
{
  _displaycontrol &= ~OLED_BLINKON;
  sendCommand(OLED_DISPLAYCONTROL | _displaycontrol);           // 0x08, -0x01 [00001**0]
}

void scrollDisplayLeft(void)                                    // Scroll Display Left (Maintains DDRAM)
{
  sendCommand(OLED_CURSORSHIFT | OLED_DISPLAYMOVE | OLED_MOVELEFT); // 0x10, 0x08, 0x00 [000110**]
}

void scrollDisplayRight(void)                                   // Scroll Display Right (Maintains DDRAM)
{
  sendCommand(OLED_CURSORSHIFT | OLED_DISPLAYMOVE | OLED_MOVERIGHT); // 0x10, 0x08, 0x04 [000111**]
}

void shiftCursorLeft(void)                                      // Shift Cursor Left (Maintains DDRAM)
{
  sendCommand(OLED_CURSORSHIFT | OLED_CURSORMOVE | OLED_MOVELEFT); // 0x10, 0x00, 0x00 [000100**]
}

void shiftCursorRight(void)                                     // Shift Cursor Right (Maintains DDRAM)
{
  sendCommand(OLED_CURSORSHIFT | OLED_CURSORMOVE | OLED_MOVERIGHT); // 0x10, 0x00, 0x04 [000101**]
}

void leftToRight(void)                                          // Text Left To Right
{
  _displaymode |= OLED_ENTRYRIGHT;
  sendCommand(OLED_ENTRYMODESET | _displaymode);                // 0x04, 0x02 [0000011*]
}

void rightToLeft(void)                                          // Text Right To Left
{
  _displaymode &= ~OLED_ENTRYRIGHT;
  sendCommand(OLED_ENTRYMODESET | _displaymode);                // 0x04, -0x02 [0000010*]
}

void autoscrollOn(void)                                         // Set Auto Scroll ON (move display with text input)
{
  _displaymode |= OLED_ENTRYSHIFTDISPLAY;
  sendCommand(OLED_ENTRYMODESET | _displaymode);                // 0x04, 0x01 [000001*1]
}

void autoscrollOff(void)                                        // Set Auto Scroll OFF (move cursor with text input)
{
  _displaymode &= ~OLED_ENTRYSHIFTDISPLAY;
  sendCommand(OLED_ENTRYMODESET | _displaymode);                // 0x04, -0x01 [000001*0]
}

void createChar(uint8_t location, uint8_t charmap[])            // Fill nominated CGRAM location with custom character
{
  location &= 0x7; // we only have 8 locations 0-7
  sendCommand(OLED_SETCGRAMADDR | (location << 3));
  //delay not required.

  for (int i = 0; i < 8; i++) 
  {
    sendData(charmap[i]);
    //delay not required.
  }
}

void setContrast(uint8_t contrast)                              // Set Contrast (Segment Brightness 0-255)
{
  // Enter OLED Command Set
  sendCommand(OLED_CMDSET_RE_1);                // Set RE = 1 [0x2A]
  sendCommand(OLED_CMDSET_SD_1);                // Set SD = 1 [0x79]
  sendCommand(OLED_SETCONTRAST);                // Enter Contrast Function [0x81]
  sendCommand(contrast);                        // Set Contrast value

  // Enter Fundamental Command Set
  sendCommand(OLED_CMDSET_SD_0);                // Set SD = 0 [0x78]
  sendCommand(OLED_CMDSET_RE_0);                // Set RE = 0 [0x28]
}

void setCGROM(uint8_t id)                                 // Set CGROM Table (A/B/C) Input = uint 0/1/2 / char 1/2/3 / char A/B/C
{  
  if      (id == 0 || id == '1' || id == 'A') cgromTable = CGROM_A;   // 0x01
  else if (id == 1 || id == '2' || id == 'B') cgromTable = CGROM_B;   // 0x05
  else if (id == 2 || id == '3' || id == 'C') cgromTable = CGROM_C;   // 0x09
  else { clear(); sendString("INVALID CGROM ID"); return; }

  displayOff();                                 // turn off display first

  // Enter Extended Command Set
  sendCommand(OLED_CMDSET_SD_0);                // Set SD = 0 [0x78]
  sendCommand(OLED_CMDSET_RE_1);                // Set RE = 1 [0x2A]
  sendCommand(OLED_SETCGROM);                   // Function Selection B [0x72]
  sendData(cgromTable);                         // Set CGROM
  
  // Enter Fundamental Command Set
  sendCommand(OLED_CMDSET_RE_0);                // Set RE = 0 [0x28]
  clear();                                      // clear display after
  
  // Send msg to screen
  if      (cgromTable == CGROM_A) sendString("CGROM-A SET");
  else if (cgromTable == CGROM_B) sendString("CGROM-B SET");
  else if (cgromTable == CGROM_C) sendString("CGROM-C SET");
  
  displayOn();                                  // restore display
}


//=======================================================================================================
// Send Commands/Data using I2C
//=======================================================================================================

void sendCommand(unsigned char command)         // Send Command
{
  Wire.beginTransmission(I2C_ADDRESS);
  Wire.write(OLED_COMMAND_MODE);
  Wire.write(command);
  Wire.endTransmission();
  //delay(10); // doesn't seem to be needed
}

void sendData(unsigned char data)               // Send Data (Character)
{
  Wire.beginTransmission(I2C_ADDRESS);
  Wire.write(OLED_DATA_MODE);
  Wire.write(data);
  Wire.endTransmission();
}

void sendString(const char *String)             // Send String
{
  unsigned char i=0;
  while(String[i])
  {
    sendData(String[i]);
    i++;
  }
}


//=======================================================================================================
// OLED INIT / POWER OFF
//=======================================================================================================

void oledInit()
{
  // Enter Fundamental Command Set [IS=x RE=0 SD=0]
  // -----------------------------------------------------
  delay(100);                                   // Power Stabilised (100ms Delay Minimum)  
  sendCommand(OLED_CMDSET_SD_0);                // Set SD = 0 [0x78]
  sendCommand(OLED_CMDSET_RE_0);                // Set RE = 0 [0x28]
  sendCommand(0x08);                            // Set Display OFF [0x08]
  
  // Enter Extended Command Set [For Subsection: IS=x RE=1 SD=0]
  // -----------------------------------------------------------
  sendCommand(OLED_CMDSET_RE_1);                // Set RE = 1 [0x2A]
  
  sendCommand(0x71);                            // Function Selection A. Internal Vdd regulator at 5V I/O application mode (double byte command)
  sendData(0x5C);                               // >> [POR DEFAULT 0x5C = Enable] [0x00 = Disable]            
  sendCommand(0x72);                            // Function Selection B. CGROM Selection (double byte command)
  sendData(cgromTable); // 0x01                 // >> Set CGROM-A  [0x01 = A]  [0x05 = B]  [0x09 = C]
  sendCommand(0x08);                            // Set Display Mode: (5 dot font width [POR], cursor inverting disable [POR], 2 line display)
  sendCommand(0x06);                            // [POR DEFAULT = 0x06] Set Com/Seg bidirection function (Note: 0x05 = 'upsidedown')

  // Enter OLED Command Set [For Subsection: IS=x RE=1 SD=1]
  // ------------------------------------------------------------
  sendCommand(OLED_CMDSET_SD_1);                // Set SD = 1 [0x79]

  sendCommand(0xD5);                            // Set Display Clock Divide Ratio / Oscillator Frequency (double byte command)
  sendCommand(0x70);                            // >> [POR DEFAULT = 0x70 [01110000]]
  sendCommand(0xD9);                            // Set Phase Length (double byte command)
  sendCommand(0x78);                            // >> [POR DEFAULT = 0x78 [01111000]]
  sendCommand(0xDA);                            // Set Segment Pins Hardware Config (double byte command)
  sendCommand(0x10);                            // >> [POR DEFAULT = 0x10 [00010000]] odd/even seg pin config
  sendCommand(0xDB);                            // Set VCOMH Deselect Level (double byte command)
  sendCommand(0x30);                            // >> 0x00 = 0.65*Vcc  0x10 = 0.71*Vcc  [0x20 = 0.77*Vcc POR DEFAULT]
                                                // >> [[0x30 = 0.83*Vcc OEM-SPEC]]  0x40 = 1.00*Vcc
  sendCommand(0xDC);                            // Function Selection C. Set VSL and GPIO (double byte command)
  sendCommand(0x03);                            // >> Internal VSL, GPIO pin HIGH for 15V generator on. [0x03=ON 0x02=OFF]
  sendCommand(0x23);                            // Set Fade Out and Fade In/Out (double byte command)
  sendCommand(0x00);                            // >> [POR DEFAULT = 0x00] Disabled
  sendCommand(0x81);                            // Set Contrast Control (Segment Brightness) (double byte command)
  //sendCommand(0xD7);                          //    215 / 0xD7 = 85%
  sendCommand(brightness);                      //    0xFF = 255[FULL]  0x80 = 128[HALF]  0x40 = 64[1/4]
                                                //    0x20 = 32[1/8]  0x10 = 16[1/16]  0x08 = 8[1/32]
  // Enter Fundamental Command Set
  sendCommand(OLED_CMDSET_SD_0);                // Set SD = 0 [0x78]
  sendCommand(OLED_CMDSET_RE_0);                // Set RE = 0 [0x28]
  sendCommand(0x08);                            // Set Display OFF
  sendCommand(0x01);                            // Clear Display
  sendCommand(0x80);                            // Set DDRAM Address
  
  delay(100);                                   // Vcc Power Stabilised (100ms Delay Recommended)
  sendCommand(0x0C);                            // Set Display ON
}

void oledPowerOff()
{
  // Enter Fundamental Command Set
  sendCommand(OLED_CMDSET_SD_0);                // Set SD = 0 [0x78]
  sendCommand(OLED_CMDSET_RE_0);                // Set RE = 0 [0x28]
  sendCommand(0x08);                            // Set Display OFF [0x08]

  // Enter Extended Command Set
  sendCommand(OLED_CMDSET_RE_1);                // Set RE = 1 [0x2A]
  sendCommand(OLED_CMDSET_SD_1);                // Set SD = 1 [0x79]
  sendCommand(0xDC);                            // Function Selection C. Set VSL and GPIO (double byte command)
  sendCommand(0x02);                            // >> Internal VSL, GPIO pin LOW for 15V generator off.

  delay(100);                                   // Wait for Vcc approaching Vbat or < Vdd. 100ms delay recommended
  
  // ****Note: VDD Should not be power off before VCC power off.
}


xpsd300
Posts: 4
Joined: May 19th, 2014, 11:04 pm

Re: LCD Smartie and SSD1311 chipset

Post by xpsd300 »

hurley wrote:Brightness is adjustable. Actually I was surprised to find the brightness level only ranges from about 50% - 100%. I'd assumed it would go down to zero, but it's fairly subtle at it's lowest setting.
Are you using a plexiglass filter with the display? I'd like to add a blue/green one to have it look like the VFD displays in my media rack, but I'm not sure if it would make it too dim. It looks like the SSD1311 OLED is only available in white and red from the manufacturer.

As long as you power it from 5VSB it'll run independent of the pc and when LCD Smartie starts up and sends data it'll take over.
Cool. Looks like the motherboard I'm planning to use (Asus Q87T) has a custom header with 3.3 and 5VSB support.

On IR, if the case comes with a plug n play remote (looks like it does from the pictures) I'd stick with that. Just power the receiver from 5VSB and tie the output pin of the receiver diode to a digital pin on Arduino, or if it's easier stick another dedicated diode next to it. Then use the boolean state of your power monitoring pin to route to some ir decoding functions in the loop part of the sketch. That way the Arduino only takes over ir decoding when the pc's off.
With this arrangement (i.e., a virtual serial port), do you think Windows Media Center would be able to recognize the Arduino as an IR device? How would it be listed in Windows Device Manager?

I can't find the pin diagram of the IR receiver that comes with the Morex case, but a barebones system was originally sold with the DH61AG motherboard, which has the following CIR header:

1 Ground
2 LED
3 No Connection
4 Learn-In
5 +5 V Standby
6 Vcc
7 Key (no pin)
8 CIR Input

This is an incomplete but functional sketch for the SSD1311 OLED on LCD Smartie.
Thanks for the great working example of the interaction between an Arduino and LCD Smartie! I'm eager to get my hands on the OLED and Arduino to test it out.

There's one annoying issue which is a feature of Arduino's and that is that they reset when anything connects via serial port.
Which type of Arduino are you using? Which board would you recommend for my intended use?

Thanks.

hurley
Posts: 46
Joined: May 26th, 2011, 8:03 am

Re: LCD Smartie and SSD1311 chipset

Post by hurley »

Uncanny timing again.
xpsd300 wrote:..do you think Windows Media Center would be able to recognize the Arduino as an IR device?
I just found out the Arduino Micro has built in USB HID keyboard/mouse emulation (and also doesn't reset on serial connect), so that would handle MCE remote tasks perfectly. Might even order one to try out myself. http://arduino.cc/en/Reference/MouseKeyboard
Without the HID feature for the remote, you'd have to send data to some serial based remote software to translate into keystrokes, which would clash with smartie for the serial port and not be worth the hassle over a $7 dedicated USB remote.
xpsd300 wrote:I'd like to display a clock...
I just ordered a couple of RTC modules. Found that the newer DS3231 based RTC's are much more accurate than the DS1307 and you can program 2 alarms into them too, plus their I2C can run at 400Kbs to match the screen.
The modules I've ordered also have 32K of I2C EEPROM (AT24C32) that can handle a million writes, perfect to store upcoming recording schedules.

Don't like dropping links to sellers but:
http://www.ebay.com.au/itm/DS3231-AT24C ... 5d4711824c
xpsd300 wrote:Are you using a plexiglass filter with the display?... ...not sure if it would make it too dim.
Haven't tried any filter's but the screens very bright at 100% so should be ok. I just have tinted perspex on my front panel.
xpsd300 wrote:I can't find the pin diagram of the IR receiver that comes with the Morex case... ...has the following CIR header:
I don't know much about CIR but I'm assuming if Morex supply the remote and receiver and you have a CIR header on your mobo that it would work out of the box. Might even boot up the pc on it's own.
From that pinout I'd say pin 8 CIR Input would be the demodulated active low output signal from the receiver diode, which you would connect to pin D3 of Arduino per the instructions here: http://www.righto.com/2009/08/multi-pro ... brary.html

The +5V Standby pin suggests the receiver is already powered when the pc's in stby/hibernated. (which also suggests it's set up to boot the pc)
If you can't find any datasheets or work it out from looking at the circuit board, before connecting pin 8 to arduino, at least confirm it has no more than 5V and then measure it while pointing the remote at it with a button held.
If the voltage drops from 5V to about 3-4V while pressing the button it's most likely the pin you want.
If you have an oscilloscope..... you already know what you're doing 8)
xpsd300 wrote:Which type of Arduino are you using? Which board would you recommend for my intended use?
I'm working now with a Nano and planned on using a Pro Mini but as of 15 mins ago I'd probably go for the Micro. see Edit2
It's almost as small as the Pro Mini anyway.
http://arduino.cc/en/Main/ArduinoBoardMicro
xpsd300 wrote:Thanks.
No worries :D

--------------------------------------------------------------------------------------------------------------------------------------------

Edit: There's a few Micro clones about. Make sure it's got ATmega32U4 chip.

Edit2: Digging deeper into the ATmega32U4 based Arduino Micro (essentially a shrunken Leonardo), it may not be ideal.
Apparently it has a lot of quirks that may be a problem, particularly bootloader issues and pins in odd places like the I2C pins and no Timer2 which the IRremote.h Library uses to decode ir signals...
Some info on this here: http://forum.arduino.cc/index.php?PHPSE ... #msg895550

I may still pick one up to try but don't need any HID keyboard/mouse since I'm just using a usb MCE remote when the pc's powered up and only need to decode the power button and maybe a couple of others when hibernated.

Probably revise that recommendation to:

Pro Mini + USB serial adapter (Smallest size, won't reset on serial connect)
or
Nano (almost as small, has USB serial adapter built in but resets on serial connect [unless modded])
or
Any of the larger ones if space isn't an issue and you'd like more IO pins. Lots of info here: http://arduino.cc/en/Main/Products

xpsd300
Posts: 4
Joined: May 19th, 2014, 11:04 pm

Re: LCD Smartie and SSD1311 chipset

Post by xpsd300 »

hurley wrote:I just found out the Arduino Micro has built in USB HID keyboard/mouse emulation (and also doesn't reset on serial connect), so that would handle MCE remote tasks perfectly.
I should probably clarify that the Asus Q87T doesn't have a CIR header. Just a custom header block for VSB, CEC, etc:

Image

I was hoping I could mod the CIR IR receiver that comes with the Morex case and use it via the Arduino as a HID to save a little money. The remote that comes with the case should work just fine since it is listed as MCE compatible.

A dedicated USB IR receiver, such as one from Inteset, might be a better choice for me given that the Pro Mini + USBSerial Adapter solution won't reset on serial connect and supports Timer2, but doesn't support HID emulation. And Micro and Leonardo do HID emulation and won't reset on serial connect, but don't support Timer2...

Although I did stumble upon someone using the Micro as a USB IR Adapter:
http://stevesprojectpages.com/arduino-m ... ter-board/

hurley
Posts: 46
Joined: May 26th, 2011, 8:03 am

Re: LCD Smartie and SSD1311 chipset

Post by hurley »

Yeah I was curious about that header and looked up the datasheet. It's very light on detail but there's some interesting pins there.
The System Management Bus would have all kinds of interesting data on it and the GPIO's could be useful.
The PWRBT seems obvious and Prog_LED's probably feedback of IR signal or maybe for a recording LED.

It'd be nice if they mentioned the current limit on that 5VSB pin.
Given the presence of USB data pins, you could assume it can handle 500ma, but I'd be cautious about sourcing any more than that from it.

The HDMI CEC is interesting, essentially controlling all AV equipment with one remote via the HDMI one wire protocol, but there's nothing in it that can't be achieved through simpler means like ir 'blasting' for instance.
- Something you can easily do with Arduino and that IRremote library.
I think it'd be worthwhile to be able to turn off your TV when you turn off your HTPC with one button as an example.
The beauty of a HTPC setup is that all the brains is in the one box and the TV just becomes a monitor which kind of makes CEC a moot point.
But yeah I'm on a rambling tangent again...
xpsd300 wrote:I was hoping I could mod the CIR IR receiver that comes with the Morex case and use it via the Arduino as a HID to save a little money.
I'm almost certain that CIR IR receiver in the Morex case is nothing but a small board with an IR diode on it, but it might have a small chip to decode boot up signals on it as well. (handy if it does)

I didn't mean to put you off the Micro, it would certainly work as a HID based receiver for MCE, just that it would require a bit deeper understanding of the Atmel hardware/Arduino programming.
And a lot of out of the box libraries like IRremote would need the source code modified to use different pins and Timers and interrupts, which could lead to frustration about why xyz doesn't work.
And it's a bitch to debug Arduino because you can't set break points and step through code like you can with pc programming.
If you're keen and confident and want to learn more about Arduino though, go for it.

On the value front:
The Micro's are about 3x the price of Nano/Pro Mini, about $8 was the cheapest I could find.
xpsd300 wrote:A dedicated USB IR receiver, such as one from Inteset, might be a better choice for me...
I got 3 of these plug'n'play MCE remotes (with mouse function) for $7 each from eBay.
[And the mouse feature is really worthwhile at times.] ** These work as a HID keyboard/mouse via USB, have a tiny receiver and need no drivers. **
http://www.ebay.com.au/itm/Wireless-Win ... 565e88c182
http://www.amazon.com/Ortek-Windows-Inf ... 365&sr=1-1#
They use a Belling BL35P12 Encoder and Holtek HT82K95E Decoder in case it's of interest to anyone.
Edit: Just been reading that for others with this remote it IS able to boot their pc's. I couldn't get that to work for me, but you might get lucky.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

So.. you see where I'm going, just trying to make things easier for ya. :)

Anyway, I must get on with coding my animated boot screens.. :D :D

..By the way, your board (Asus Q87T) has a com port header too. If it's 5V TTL you can wire that straight to pins 0/1/GND on your Arduino.
---> (no need for USB, no issues with reset on connect regardless of which Arduino you choose)

xpsd300
Posts: 4
Joined: May 19th, 2014, 11:04 pm

Re: LCD Smartie and SSD1311 chipset

Post by xpsd300 »

hurley wrote:By the way, your board (Asus Q87T) has a com port header too. If it's 5V TTL you can wire that straight to pins 0/1/GND on your Arduino.
---> (no need for USB, no issues with reset on connect regardless of which Arduino you choose)
I'm actually planning to wire the COM port header to a common anode RGB LED to show other Windows Media Center statuses, such as when programs are being recorded (red) or an an extender is in use (yellow), and to serve as the power LED (white) for the chassis.

More info can be found on the LEDSdriver website, http://slicksolutions.eu/ledsdriver.shtml.

Post Reply