Click here to Request a Sample from any Manufacturer represented by Ismosys

 PIC MCU for CMOS Sensor Camera applications


Date: 16/3/2009

Harnessing a PIC 16F87 MCU for CMOS Sensor Camera applications

Microchip PICs are the MCU of choice in a wide variety of applications, thanks to the unique combination of cost, features and performance they offer. Among the emerging applications that Microchip is currently addressing, CMOS sensors for video surveillance applications pose particular challenges, even for a well established PIC aficionado.

CMOS video sensor configurations are quite complicated and in order to pilot one it’s essential that the PIC features a dedicated video port.  The PIC 16F87 is an ideal solution.

The next challenge is the actual image acquisition: Based in the heart of Paris, Cynove www.cynove.com  is a specialist in the implementation of video solutions based around its proprietary CMOS sensor technology, which is easily adaptable to any USB 2.0 High Speed link or DSP specification. The company offers an innovative DSP-based camera module (DSPCAM) which enable the PIC MCU to acquire images very simply via a UART link.

Cynove Cmos Camera Sensor
The Cynove DSPCAM camera module ‘wakes up’ one second of initialisation. It accepts orders from the remote host through its UART port. An easy to use API is provided with a list of accepted orders. A .h file and examples are also provided with the module. With this API, the remote host is able to ask for the acquisition of an image, or up to ten consecutive images. In order to reduce file sizes the camera module compresses the images in JPEG file format and sends the images through the UART port when instructed by the PIC host. The module offers several transfer modes that enable even low memory hosts to receive the image files, e.g. bytes per bytes, or small part per small parts (typically 128 bytes), a particularly useful feature when the PIC host has to send the image through a GSM module or some other low-bandwidth medium.


The DSPCAM camera module features a SendOrder function (BYTE * Buffer, short length) that sends orders to the camera board through the UART, and a corresponding ReceiveAnswer function (BYTE * Buffer, short * plength) that receive answers from the camera board. The Camera_Power (int on) function powers the camera up or down as and when required by the application. 

The Cynove camera module can be adapted to any resolution required by the sensor application. Even MPEG4 encoding is achievable.

Schematic Application

Cynove Schematic
Microchip PIC16F87


Software:

Thanks to the functionality provided by the PIC16F87 and the DSPCAM it is easy to obtain the image from the Cynove Camara module. To illustrate this the required code, in C, is provided below:

BYTE Buffer[256];
int jpeg_length;
int i;
Camera_Power(1);
Sleep(1);
Buffer[0] = 0x01;
Buffer[1] = 0x98;  // order to acquire and compress an image
SendOrder(Buffer,2);

Buffer[0] = 0x01;
Buffer[1] = 0x91;
SendOrder(Buffer,2);  // order to ask jpeg file size
ReceiveAnswer(&jpeg_length,4);
 
for (i=0; i {
 // ask for 256 bytes of jpeg file from offset i
 Buffer[0] = 0x01;
 Buffer[1] = 0x94;
 Buffer[2] = (i >> 24) & 0xFF;
 Buffer[3] = (i >>16)&0xFF;
 Buffer[4] = (i>>8)&0xFF
 Buffer[5] = i & 0xFF;
 Buffer[6] = (256 >> 8) & 0xFF;
 Buffer[7] = (256) & 0xFF;
 SendOrder(Buffer,8);
 ReceiveAnswer(Buffer,256);

 // deal with part of jpeg file

Camera_Power(0)

 

  Top    
  Back

Ismosys.com Engineering Solutions for the Global Electronics Industry