Category Archives: |Opentronix

Wiring the ST7735R TFT LCD to the imx233-Olinuxino-Micro – II

Now that you’ve recharged your batteries let’s proceed and connect our display.

Let’s start by wiring the ST7735. You can read more information about the ST7735 in the datasheet controller/driver chip.


As you can see in the picture this LCD uses Serial Peripheral Interface bus (SPI): MISO, SCLK, MOSI and CS pins are used for SD card communication; SCL, SDA, RS/DC, and CS pins – 4-lines/8-bts bi-directional interface – for communication between the micro controller and the LCD driver.

The imx233-Olinuxino-Micro pinout can be found in the user’s manual, chapter 6. Page 32 also provides a reference to a pinout summary made by David Whittaker, which is quite useful.

Here is how we did it:

LCD pin Olimex pin GPIO Function
SCL (SCK) CON2#11 GPIO#24 Serial CLock – Clock pulses which synchronize data transmission generated by the master
SDA (MOSI) CON2#10 GPIO#20 Serial DAta (input/output) – (MOSI Master Out Slave In) – Master line for sending data
RS/DC CON1#17 GPIO#6 RS/DC data/command flag
RES CON1#16 GPIO#5 Reset
CS CON1#13 GPIO#2 Chip Select (SS – Slave Select) – enables (like a switch) communication access to device.

Then connect VCC to +3.3V and GND to ground.

[MISO -> CON2#9 (GPIO#0)  (Master In Slave Out) – Slave line for sending data to the master. NOTE: we did not connect this one, at least for now.]

Now, recheck your wires and then feed your imx233.


Login by entering  username and password [defaulf should be usr: root, pass: root].

Next, you will need to enable the display module named fbtft_device, which was made available in the kernel in the previous post. [NOTE: the driver names this display adafruit18.]

You can confirm that the module for this display was loaded by entering:

Likely you’ll need to install “something” to help you viewing your images using the linux framebuffer console. We use frame buffer imageviewer (fbi). [Some linux distributions name it fbida.]

Now you are ready to play!


Building a kernel for imx233-Olinuxino-Micro + wireless + TFT LCD [ST7735R/ILI9325] – I

We had our imx233-Olinuxino-Micro in its box for too long but we finally managed to run some electrons through it 🙂

We needed to have our wifi USB module – Realtek RTl8192cu Chipset working. Also, we wanted to connect our TFT LCD displays : the 1.8″ Color TFT LCD display with MicroSD Card Breakout – ST7735R, and try also the 2.8″ 18-bit color TFT LCD with touchscreen breakout board – ILI9325. [Check the next posts for wiring instructions.}

After some pains in finding the right linux kernel and drivers…we followed the great tutorial provided by g-lab, and made a few changes. Hopefully this will be of help for some of you out there. So here we go…

Getting some files

1. Start with a working SD card image. We got imx233 Debian 2GB SD-card image based on Kernel 3.11 following the link.

Want to know how to make a bootable SD Card? Look here

2. Get the package provided by g-lab link, which contains Freescale imx-bootlets, utility elftosb2 and patches for the imx23-board.

Building the kernel

You will need to know how to build your own kernel and create a bootable image.

We used the 3.18.3 kernel. You can try another one. It is likely that any 3.x.x will work too.

To enable SPI we made our own patch. Get it as follows or Read on what you need to do...

Open imx23-olinuxino.dts file

look for ssp1: ssp@80034000 {… and add/change


cd into directory linux-mainline to apply  i2c patches for imx23-olinuxino board. These are required for your i2c communication devices. Also, apply our SPI patch.

We found this great driver for our LCD’s. Download sources and install it:

Read on how we got this file...

Either the wireless or the lcd were not working among all our kernel compilations. Since we were banging our head on the screen for a couple of days we decided to post our way around the thing. Boot your olimex with the abovementioned image [imx233 Debian 2GB SD-card image based on Kernel 3.11], then go to /proc and save the config.gz to your computer. You can use gunzip and save the file. This file contains already what is needed to get the wifi USB module – Realtek RTl8192cu Chipset working.

If you do not use the .config we provide here, you will have to add a few things with the menuconfig. Read more.

Open menuconfig

You will get something like this

Building a kernel for imx233-Olinuxino-Micro + wireless + TFT LCD [ST7735R/ILI9325] - I


Go to Device Drivers -> Graphics support -> Frame buffer devices->

Save and exit menuconfig.

Compile kernel

Mount your SD card and do [NOTE: Check where is your SD card partition is mounted and enter the path in the following line. For example we use kubuntu and had it mounted in /media/opiliao/rootfs]:



Switch into directory boot/elftosb-0.3 and make symbolic link into the compilers default PATH [elftosb2 should be located at /usr/sbin/elftosb2]

Next, switch into directory boot and do:

Now, switch into directory boot/imx-bootlets-src-10.05.02 and apply patches

This patched package require zImage in this directory. We have created zImage_dtb instead.

You should be ready to dump the image to your SD card. If your SD device is /dev/sdb1 do: [Note: you can check it by doing: sudo fdisk -l]

The card is ready, insert on your board and boot….IT WORKS!

Take a 10 min break before continuing…see you in the next post 😉


Interfacing the DS1077 oscillator module

The DS1077 Package

This IC comes in a SOIC package, therefore Sparkfun did a nice breakout board for it. In this project we used the breakout board, but if we were using the bare chip everything should work the same way as described here. This module can oscillate at 8200 different frequencies from 16kHz up to 133Mhz and can be reprogrammed at runtime using a I2C serial interface.

Experimental Setup

For a test setup a PIC16F628A was connected to the DS1077, by using the pins RA0 for data transmission (SDA), RA1 for synchronous clock (SCL). Some LEDs were also connected to the PIC, they are not required but it is always good to have some flashing leds around so we know that something is wrong when they stop flashing.



Microcontroller code

It is always a good approach to start by trying to find out if somebody did already before what we need. Unfortunately in this time only some code for the Arduino was available, as this project was assigned to a PIC controller we had to build a small library for the DS1077 ourselves.

We released the DS1077 library under the GPL license, it works with the CCS compiler, and should be used as in the supplied example. This library was initially developed for the PIC16F628A/PIC16F876A but should work with most of the members of the PIC family (PIC18 included), remember to modify the test program to suite your microcontroller.

    • Download the library here: ds1077.c
    • Download the example here: test.c

The only relevant function is: int32 ds1077_frq(int32 frq); where frq is requested frequency in kHz and it returns processed frequency in kHz.

Some Results

We recorded the output of DS1077 when controlled with the test program. The test program changes the frequency every second, and we found that the response of the oscillator is quite good, also the frequency resolution looks quite nice on a “log” plot. Note that on the figure the missing points are due to a gap in the frequency acquisition, not in the waveform generation.