Arduino Duemilanove (Atmel ATmega328) to 4dSystems uOLED-128-G1
This project was meant to be a learning exercise in controlling a peripheral device with a Microcontroller. Initially, the idea was to make a microcontroller on a FPGA and have it control some sort of high resolution display, like an OLED. The FPGA design would have to consist of logic that controls the horizontal/vertical line and pixel count and be able to dynamically control what color that goes in each pixel based on some sort of predefined picture or text. After doing some research I found that pretty much all displays over 64×64 are already controlled by a microcontoller and you basically have to interface too it. I explored the option of just using a VGA display because it requires that you control horizontal/vertical flags to display anything and it seemed like the most basic(hardest) way to control a display. I was able to write a short program that could display my name in the middle of the screen but decided to go a different route. Realizing I would have to use the FPGA to interface to a microcontroller, which I had no idea how to do, I decided to use a microcontroller and scrap the FPGA idea for now. I should mention now that before i started this project i pretty much only new how to design systems on a FPGA and programs on a microcontrollers that I created on my own. Meaning, I had no knowledge of the interfaces out there like SCI and VGA, I heard of them, but did quite understand how/why they were used. Needless to say, that is very different now.
The Arduino Duemilanove is a good choice for a microcontroller since it offers a very easy to use development environment. The user will write all their code in C++ utilizing a very good library built by the Arduino crew. This library is constantly updated, extremely well documented, and the there is a large user base for when you need help beyond what is already offered. The Arduino development boards are really easy to get started with, just plug in the USB cable to your computer, it will power the Arduino and you will be able to send your code through the software available at the Arduino website. Check out http://www.arduino.cc for more information.
Originally, the project was to use this OLED Carrier Board from sparkfun, http://www.sparkfun.com/commerce/product_info.php?products_id=763 . This is thing was a piece of junk, I had so many issues with this piece of hardware it wasn’t even funny. Like I stated, this project was a learning exercise and this OLED Carrier Board made that very difficult to achieve. I think I just got a bad board maybe, the OLED Carrier Board never did power up once so ever. My professor and I tried everything we could including help from sparkfun and nothing. On top of that, the documentation was incredibly bad! There are datasheet, schematic, and user manual PDF’s that all contradict themselves! The biggest problem is the labeling of the pinns and how to power the device by either using the included voltage booster or not, it was just ridiculous! The user based was almost non-existent, no wonder why.
I scrapped the OLED Carrier Board and went with a 4dSystems uOLED-128-G1. After receiving it in the mail, I hit the ground running! The documentation is great, too the point, organized, and very detailed. This uOLED very adaptable too. It has two basic modes of operation, SCI and GOLDELOX. The SCI, Serial Connect Communications Interface, is used if you want to control this with an external microcontroller, like I am, and the GOLDELOX processor is used to execute code that you will write on your PC. This code is its own proprietary language and has a compilier to go with it, found at http://www.4dsystems.com.au/. This is used mainly to make the uOLED a stand-alone device and works quite well but wasn’t the point of this project.
Step by Step guide for interfacing an Arduino Duemilanove to a 4dSystems uOLED-128-G1
Arduino to uOLED Connections
Pretty simple here, just double check all your wires and use a really good, consistent, color scheme.
- Tx from Arduino to Rx on uOLED
- Rx from Arduino to Tx on uOLED
- 5v VCC from Arduino to VCC on uOLED
- GND from Arduino to GND on uOLED
- Pin8 from Arduino to Reset on uOLED
- Loose wire is to set pin2, 3, 4, or 5 to HIGH
Uploading Arduino Code
1. Arduino software package found here, http://arduino.cc/en/Main/Software .
2. Download Arduino-0014 and Arduino-011. After Arduino-011 they made a significant change to the code and got rid/changed some commands like printByte() changing to Serial.print(). printByte() is NOT supported in any Arduino software after Arduino-011 and this code uses printByte(), so you have to compile with Arduino-011.
3. Unpack Arduino-011.zip to “C:\Arduino\Arduino-011\”
4. Create a directory “c:\Arduino\Work\”
5. Put “Arduino_to_uOLED“ folder in “c:\Arduino\Work\”
6. Run “c:\Arduino\Arduino-011\arduino.exe”
7. Click file->sketchbook->open
8. Point to file “c:\Arduino\Work\Arduino_to_uOLED\Arduino_to_uOLED.pde”
9. Connect USB cable to Arduino and to the PC, let the drivers install.
10. Click file->Upload to Board
11. Your board should now have the code loaded into it! If not, read troubleshooting Arduino.
1. Check COM port in Device Manager, it should match the COM port in the Arduino program under Tools->Serial Port->COM(#)
2. Ensure the proper board is selected in the Arduino Program under Tools->Board->Arduino Diecimila (for use with Arduino Duemilanove.
3. Reference this guide if further help is needed, including an updated list of USB to Serial drivers http://arduino.cc/en/Guide/Windows
Configuring uOLED SCI
- The uOLED-128-G1 must use a standard uSD, not a HC uSD, and must be 1GB or smaller.
- SCI pdm must be loaded as the firmware to use the Serial Connect Interface, See Load Firmware
1. Download Graphics Composer Ver2.xx at http://www.4dsystems.com.au/downloads/Graphics_Composer/Ver2.XX/GraphicsComposer.zip save to “c:\Arduino\”
2. Extract GraphicsComposer.zip to “c:\Arduino\GraphicsComposer v2.xx”
3. Run “c:\Arduino\GraphicsComposer v2.xx\GraphicsComposer.exe”
4. Click Device->Load Options
5. Select Serial Command Platform
6. Drive: “Letter of uSD Drive EX: E:\” click OK
7. Create a new gcs project, File->New, name it uSD_Images.gcs
8. Right Click in Actions window to add images or videos. Must be JPEG, BMP, MPEG, AVI
9. Save the project when finished, File->Save
10. Load to Device, Device->Load
11. Click Txt icon to open uSD_Images.txt
12. In the txt file you must match the HEX commands in your Arduino code
Configuring uOLED 4DGL – GOLDELOX Graphics Processor
- The uOLED-128-G1 must use a standard uSD, not a HC uSD, and be 1GB or smaller.
- 4dGL firmware must be loaded to use the GOLDELOX, See Load Firmware
- Download the 4dGL Program at http://www.4dsystems.com.au/downloads/4DGL-Installer/Install-4DGL-Workshop-Beta-2_4.zip
1. Connect the Serial to USB connecter to your PC and to the uOLED, the drivers will auto install.
2. Download PmmC and save to “c:\Arduino\PmmCLoader\PmmCLoader\PmmCs\”
a. SCI – http://www.4dsystems.com.au/downloads/micro-OLED/uOLED-128-G1/PmmC/Serial/uOLED-128-G1-Serial_rev1.PmmC
b. 4dGL – http://www.4dsystems.com.au/downloads/micro-OLED/uOLED-128-G1/PmmC/4DGL/uOLED-128-G1-4DGL-rev2.PmmC
3. Download PmmCLoader at http://www.4dsystems.com.au/downloads/PmmC-Loader/Software/Windows/PmmCLoader.exe
4. Extract to “c:\Arduino\PmmCLoader\”
5. Run “c:\Arduino\PmmCLoader\PmmCLoader”
6. Check COM port in Device Manager, it must match the COM port in the PmmCLoader.
7. File to Load: “c:\Arduino\PmmCLoader\PmmCLoader\PmmCs\PmmC file”
8. Click Load.
At power up, the routine on pin2, “ 2 Display Pics”, may run automatically. It may be due to the white tape holding the Arduino to the breadboard, it could be causing a short.
Also, you can ground pin2 with the lose wire at startup, this will keep the menu active. The original design called for a switch on the breadboard instead of the lose wire. This will ensure the buttons are kept either HIGH or LOW. Below is the switch schematic.