Facebook Pixel

AN-00048 Designer or ViSi uCAM-III Demo for Goldelox Displays

Description

The uCAM-III (microCAM-III) is a highly integrated serial camera module which can be attached to any host system that requires a video camera or a JPEG compressed still camera for embedded imaging applications. The module uses a CMOS VGA colour sensor along with a JPEG compression chip that provides a low cost and low powered camera system. The module has an on-board serial interface (TTL) that is suitable for a direct connection to any host micro-controller UART or a PC system COM port. The uCAM-III is capable of outputting both RAW format and JPEG format images.

Supported Processor GOLDELOX
Supported Environment Designer, ViSi
Difficulty Medium

 

File Downloads
Files

 Description

This application note shows how to interface the uCAM-III serial camera module to a Goldelox display. The environment used is Designer.  The 4DGL code of the Designer project can be copied and pasted to an empty ViSi project and it will compile normally. The code can also be integrated to that of an existing ViSi project.

 

Before getting started, the following are required:

  • Any of the following 4D Goldelox display modules:

When downloading an application note, a list of recommended application notes is shown. It is assumed that the user has read or has a working knowledge of the topics presented in these recommended application notes.

Application Overview

The uCAM-III (microCAM-III) is a highly integrated serial camera module which can be attached to any host system that requires a video camera or a JPEG compressed still camera for embedded imaging applications. The module uses a CMOS VGA colour sensor along with a JPEG compression chip that provides a low cost and low powered camera system. The module has an on-board serial interface (TTL) that is suitable for a direct connection to any host micro-controller UART or a PC system COM port. The uCAM-III is capable of outputting both RAW format and JPEG format images.

The application described in this document makes use of a uOLED-128-G2 to display the images (RAW format only) captured by the uCAM-III. The images are transmitted serially from the uCAM-III to the uOLED-128-G2. The application has an interface for the user to be able to configure the image format, resolution, baud rate, and mode. The user input is a joystick, since Goldelox displays are not touch-capable. Below is a simple diagram for the application.

Setup Procedure

For instructions on how to launch Workshop 4, how to open a Designer project, and how to change the target display, kindly refer to the section “Setup Procedure” of the application note

Designer Getting Started - First Project

For instructions on how to launch Workshop 4, how to open a ViSi project, and how to change the target display, kindly refer to the section “Setup Procedure” of the application note

ViSi Getting Started - First Project for Goldelox

 

Create a New Project

For instructions on how to create a new Designer project, please refer to the section “Create a New Project” of the application note

Designer Getting Started - First Project

For instructions on how to create a new ViSi project, please refer to the section “Create a New Project” of the application note

ViSi Getting Started - First Project for Goldelox

 

The uCAM-III Serial Camera Module

Click on the hyperlink for the uCAM-III under the section “Description” to go to its product page.

The uCAM-III Datasheet

The datasheet for the uCAM-III is available under the Downloads section of its product page.

The datasheet is essential to understanding the 4DGL code of the attached demo project.

Serial Communication

Shown below is the pin configuration for the uCAM-III.

Below is a table of descriptions for the pins. 

More information about the pins and serial communication feature of the uCAM-III can be found in the datasheet. The uCAM-III can be connected to the PC using a 4D USB programming cable or a uUSB-PA5. A special application for Windows has been created for the uCAM-III. This application can be used to send and receive messages to and from the uCAM-III. This can be downloaded from the Downloads section of the product page.

The application is also available in Workshop. Under the File menu, click New, and choose the uCAM-III product.

 Click on the “Next” arrow.

The application is useful for understanding the uCAM-III serial communications protocol and testing the uCAM-III before using it in an embedded application.

 

Test the uCAM-III

Use a 4D Programming Adaptor to connect the uCAM-III to the PC. The pins of the programming modules and of the uCAM-III are labelled to prevent wrong orientation.

Connect using a 4D USB Programming Cable

Connect using a uUSB-PA5

The uCAM-III Demo Software

Open the uCAM-III Demo application.

 The shortest sequence for communicating with the uCAM-III is shown below. This sequence is for getting a RAW image from the uCAM-III. On the left column are the commands sent from the host to the uCAM-III. On the right column are the commands sent from the uCAM-III to the host.

This sequence is illustrated in section 7.4.2 (Example for taking a RAW image) of the uCAM-III datasheet. The commands are detailed in section 6 (Command Set). This sequence will be demonstrated using the uCAM-III Demo Software in the following discussions. The attached Designer project implements this sequence in 4DGL. Sections 7.3 Taking Snapshot Pictures and 7.4 JPEG Pictures (Video) illustrate other examples of command sequence. The reader is encouraged to try out these examples using the uCAM-III Demo Software.

Open the Serial Port

Select the appropriate port for the 4D programing module and set the desired baud rate.

 

Now click on the button with the label “Open comms”.

Note that three buttons are numbered from 1 to 3 – “1. Open comms”, “2. Sync”, and “3. Init”.

Synchronise with the uCAM-III

Click on the Sync button.

The terminal on the right part of the window logs the messages sent to and received from the uCAM-III.

In the image shown above, the PC has sent the SYNC command [AA 0D 00 00 00 00] nine times before the uCAM-III responds with an ACK [AA 0E 0D 00 00 00] and a SYNC [AA 0D 00 00 00 00]. For more information about the SYNC command, refer to section “7.1 Synchronising the uCAM-III” of the datasheet. To know more about the ACK command, refer to section “6.9 ACK” of the datasheet.

Initialize the uCAM-III

Choose 16-bit Colour for the Color Type.

Choose 128x128 as the RAW resolution.

Now click on the Init button.

The terminal displays the messages shown below.

The PC sends the Initial or INIT command [AA 01 00 06 09 03] and the uCAM-III responds with an ACK [AA 0E 01 02 00 00]. For more information about the Initial or INIT command, refer to section “6.1 INITIAL” of the uCAM-III of the datasheet.

N.B.: If the uCAM-III is unable to respond, click on the SYNC button. The uCAM-III automatically goes to sleep after 15 seconds of being idle. Clicking on the SYNC button wakes it up.

Get Picture

Click on the “Get Picture” button.

The Get Picture command is sent and the uCAM-III responds with an ACK, a DATA, and the actual image data. These three sets of replies from the uCAM-III are highlighted below.

The received image is displayed on the left part of the window.

To know more about DATA, refer to section 6.7 (DATA) of the datasheet. Note that the host seals the transaction by sending an ACK after it has received the complete actual image data.

Design the Project

The User Interface

The application has an interface for the user to be able to configure the image format, resolution, baud rate, and capture mode. The user input is a joystick, since Goldelox displays are not touch-capable.

The Joystick

The Joystick is essentially a five-position multiswitch. Each position connects to a junction of a resistor ladder network that forms a voltage divider. The output of the joystick voltage divider connects directly to the IO1 pin of the Goldelox display module. The IO1 pin can be programmed as an Analogue to Digital (A2D) converter in the Workshop 4 IDE. Utilising the analog-to-digital-conversion feature of Goldelox displays, each individual switch position voltage value can be read and decoded. Below is the schematic diagram for the joystick. Note that the circuit can also be implemented using tactile switches and resistors.

The UP and DOWN positions enable the user to navigate between the four menus of the interface - image format (Fmt), image resolution (Res), baud rate (Baud), and capture mode (Mode). The currently selected menu will be highlighted.

The LEFT and RIGHT positions enable the user to set the value for each menu.

The PRESS or FIRE position allows the user to take a picture.

Image Format

The uCAM-III can support four different image formats.

The application supports two RAW formats only – 8-bit Gray Scale (RAW, 8-bit for Y only) and 16-bit Colour (RAW, 565(RGB)).

Image Resolution

The uCAM-III can support four different image resolutions when in RAW mode.

The display resolution of the target screen determines the maximum RAW image resolution that can be supported. When creating a new project in Workshop, the Choose-Your-Product window shows the resolution of the display modules.

The table below shows the RAW image resolution supported by each Goldelox display module.

Baud Rate

Section “6.5 Set Baud Rate” of the datasheet shows the baud rates supported by the uCAM-III. The application supports three baud rates – 57600, 115200, and 153600 bps.

Capture Mode

The application has two capture modes – single and continuous.

Run the Program

For instructions on how to save a Designer project, how to connect the target display to the PC, how to select the program destination, and how to compile and download a program, please refer to the section “Run the Program” of the application note

Designer Getting Started - First Project

For instructions on how to save a ViSi project, how to connect the target display to the PC, how to select the program destination (this option is not available for Goldelox displays), and how to compile and download a program, please refer to the section “Run the Program” of the application note

ViSi Getting Started - First Project for Goldelox

The uOLED-96-G2 and/or uOLED-160-G2 display modules are commonly used as examples, but the procedure is the same for other displays.

 

Connect the uCAM-III to the Display

The image below shows the connection diagram of the setup. The programming module (4D USB programming cable or uUSB-PA5) can be used to power the display and the uCAM-III.  

 

 

Share: