CMOS CAMERA MODULE JC418M-J01 Deqing Jiahe Electronic Technology Co., Ltd. TEL: +86-572-8051676 ext. 803 FAX: +86-572-8051676 ext. 801 sales@jiahe-electronic.com
Application The JC418M-J01 JPEG compression module performs as a video camera or a JPEG compressed still camera and can be fixed into all kinds of system. For example: remote monitoring, vehicle monitoring, visible the doorbell, camera phones, digital image records, industry control, access control, etc. Users can send out a snapshot command from the host in order to capture a full resolution single-frame still picture. The picture is then compressed by the JPEG engine and transferred to the host. Feature 1. Small in size: 32mm x 32mm or 38mm x 38mm (L x W). 2. 2.0M CMOS sensor, resolution up to 1920x1080. 3. Video-out: 720P & 30fps or 1080P & 25fps, optional. 4. Low power consumption, 3.3V or 5.0V operation. 5. UART interface support up to 2.0Mb/s. 6. Built-in JPEG CODE. 7. Built-in lens, optional. Outline
Block Diagram Pin Function PIN Symbol FUNCTION 1 TV VIDEO OUT 2 T Tx 3 R Rx 4 G GND 5 P Vcc 6 O SPI_SO 7 I SPI_SI 8 C SPI_SCK 9 CS SPI_SS * (SPI is closed) Lens Structure
Specification Item Specification Remark Pixel Size 1280x720 / 1920x1080 720P default Image Sensor 1/4 CMOS sensor Baud Rate UART Output 9.6K/38.4K/115.2K/230.4K/460.8K/921.6K/1.0M/1.8432M/2.0Mbps TTL level Video Output PAL / NTSC NTSC default Image Format Operating Voltage Working Current JPEG 5.0V±10% or 3.3V±10% 180 ma Construction: 4G+IR filter 850nm IR Effective Focal Length:2.7mm Lens F#:2.7 FOV:80 Distortion <18% Relative illumination: 60% Ø3.44 Operating Temp. -20 C~+60 C
1. Serial Interface 1.1 Baud Rate User Manual JC418M-J01 supports total 9 types of baudrate: 9,600bps, 38400bps, 115200bps, 230400bps, 460800bps, 921600bps, 1.0Mbps, 1.8432M and 2.0Mbps. Default baudrate is 115,200bps. In other words, host needs to use 115200bps at the first connection with JC418M-J01. After the first connection, host can change the baudrate to other supported values. 1.2 Single Byte Timing Diagram A single byte RS-232 transmission consists of one start bit, 8-bit contents and one stop bit. A start bit is always 0, while a stop bit is always 1. LSB is sent out first and is right after the start bit. Figure 5 RS232 communications single byte timing diagram 1.3 Command Timing Diagram A single command consists of 4 or more (depends on data length s value) continuous single byte RS-232 transmissions. The following is an example of GET VERSION (56h, 00h, 11h, 00h) command. Figure 6 GET VERSION command timing diagram
1.4 Command summary Command GET VERSION SYSTEM RESET READ FBUF SET BAUDRATE SET SAMPLESIZE SET COMPRESS RATIO SET ID Functions Get Firmware version information System reset Take picture and read frame buffer Set serial baud rate Set image size Set image compressed rate Set serial number Host will get reply command from JC418M-J01 Table 1 command summary 1.5 Command format Protocol sign(1byte) + Serial No.(1byte) + Command(1byte) + Control data(nbytes) Protocol sign: This one byte field indicates the transmitting mode of the command. Protocol sign value definitions Sending command 56h The command is sent from the host to JC418M-J01 Replying command 76h Command is received from JC418M-J01 to the host Table 2 protocol sign Serial No.: Now this one byte field is invariably set to 0. Command: This one byte filed indicates the command function. About the detail, please refer to Table 3 command set. Control data: The data of this field is only meaningful when Data length is not equal to 0. This data depends on the different commands. About the details, please refer to the following sections.
1.6 Command protocol Command name Protocol Serial Command Control sign No. value data Remark GET VERSION 56h 00h 11h 00h Don t care SYSTEM RESET 56h 00h FFh 00h Don t care READ FBUF 56h 00h 32h 0Ch Take picture and read frame buffer SET BAUDRATE 56h 00h 31h 06h To know data vaule of this field, please SET SAMPLESIZE 56h 00h 30h 04h refer to the following sections SET COMPRESS RATIO 56h 00h 29h 05h SET ID 56h 00h 28h 02h Set serial number 76h 00h Depends on the different sending commands. To know data value of this field, please refer to the following sections Table 3 Command set 1.6.1 GET VERSION Command The GET VERSION command is used to get version information of the firmware running in JC418M-J01. 1.6.1.1 Command format: 56 00 11 00 1.6.1.2 : 76 00 11 00 0B 4A 43 34 31 38 4D 20 56 31 2E 30 ("JC418M V1.0") 6.6.1.3 Communication protocol: To get the firmware version, please follow the below operations: HOST GET VERSION 56 00 11 00 MODULE 76 00 11 00 0B 4A 43 34 31 38 4D 20 56 31 2E 30 1.6.2 SYSTEM RESET Command The SYSTEM RESET command is issued by the host in the following case: There is always no reply after several commands were sent by host. 1.6.2.1 Command format: 56 00 FF 00 1.6.2.2 : 76 00 FF 00 00 P3 P3: 00 (1bytes) After around 3s, module send out P3.
1.6.2.3 Communication protocol: SYSTEM RESET 56 00 FF 00 76 00 FF 00 00 Delay 3000ms 00 When the host has received the correct [76 00 FF 00 00], around 10ms later, JC418M-J01 is going to restart, around 3s later, JC418M-J01 works normally as usual. 1.6.3 READ FBUF command The host sends this command to get the image data from frame buffer. 1.6.3.1 Command format: 56 00 32 0C 00 1.6.3.2 : 76 00 32 00 FF P4 P5 where P4 (4 bytes) is the image size. P5 is image data which host wants to get. 1.6.4 SET BAUDRATE command The host issues this command to set the UART baud rate. 1.6.4.1 Command format: 56 00 31 06 P6 where P6 (1 bytes) is the configuration value of UART baud rate. The relationship between configuration value and baud rate is shown in Table 5. Baud rate(bps) Configuration value 9600 0x00 38400 0x01 115200 0x02(default) 230400 0x03 460800 0x04 921600 0x05 1.0M 0x06 1.8432M 0x07 2.0M 0x08 Table 5 Baud rate relationship
1.6.4.2 : 76 00 31 06 P6 1.6.4.3 Communication protocol: Set baud rate to 9600bps SET BAUDRATE 56 00 31 06 00 76 00 31 00 06 00 Set baud rate to 115200bps SET BAUDRATE 56 00 31 06 02 76 00 31 00 06 02 1.6.5 SET SAMPLESIZE command The host issues this command to set the sample size of image (image resolution). 1.6.5.1 Command format: 56 00 30 04 P7 where P7 (1 byte) is the configuration value of image sample size. The relationship between configuration value and image resolution is shown in Table 6. Image resolution 1920x1080 1280x720 Configuration value 0x01 0x02 (default) Table 6 image resolution size relationship 1.6.5.2 : 76 00 30 00 04 P7 1.6.5.3 Communication protocol:
SET SAMPLE SIZE 56 00 30 04 02 Set image size to 1280x720 76 00 30 00 04 02 1.6.6 SET COMPRESS RATIO command The host issues this command to set compress ratio of the image. 1.6.6.1 Command format: 56 00 29 05 P8 where P8 (1 byte) is the configuration value of image compression ratio. This compression ratio value is ranged from Q85 to Q05. The bigger the value is, the lower the compression ratio. Default compression ratio is Q85. COMPRESS RATIO Configuration value Q85 Q75 Q65 Q55 Q45 Q35 Q25 Q15 Q05 0x00 (default) 0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 1.6.6.2 : 76 00 29 00 05 P8 1.6.6.3 Communication protocol: SET COMPRESSION RATIO 56 00 29 05 05 Set image compression ratio to 55% 76 00 29 00 05 05
1.6.7 SET ID command The host issues this command to set ID. 1.6.7.1 Command format: 56 00 28 02 P9 where P9 (1 bytes) is the configuration value of serial number (0~255). The relationship between configuration value and baud rate is shown in Table 5. ID Configuration value 00 0x00(default) 01 0x01 FF 0xFF Table 5 Baud rate relationship 1.6.7.2 : 76 00 28 00 01 P9 1.6.7.3 Communication protocol: Set ID to 02 SET ID 56 00 28 02 02 76 00 28 00 01 02 1.6.8 command The is a UART command which is sent from JC418M-J01 in order to inform the host whether the command which was just sent is executed well or in order to transmit the data which the host wants to get. About all cases of command please refer to the above commands sections. NOTE: When the host issues SET BAUDRATE command, SET SAMPLE SIZE command or SET COMPRESS RATIO command, the system needs to reset to take effect. These parameters are stored into camera module s built-in EEPROM. So next time module boots up, these parameters still work.
Appendix A Flow diagram for getting an image Below is the flow diagram for getting one or more images: Camera module power up Wait for 3000ms Connect with camera module @ 115200bps Y N Camera module power down Needs to change EEPROM parameters (baud rate, image resolution, compress ratio)? N Y Set BAUD RATE Set SAMPLE SIZE Set COMPRESS RATIO Y SYSTEM RESET Wait for 3000ms Connect camera module at new baud rate Y Wait for 2000ms SYSTEM RESET N (Try 3 times) Send GET FBUF command to get image data Y Output data Get image data loop
Appendix B: Communication example for getting an image Below is the example for how to get a 720p image by UART @ baud rate 115200bps and higher compression ratio. Set UART baud rate 115200bps SET BAUD RATE 56 00 31 06 02 76 00 31 06 02 SET SAMPLE SIZE 56 00 30 04 02 Set image format size to 1280x720 76 00 30 00 04 02 SET COMPRESSIONRATIO 56 00 29 05 05 Set image compression ratio to Q35 76 00 29 00 05 05 SYSTEM RESET 56 00 FF 00 76 00 FF 00 00 Delay 3000ms 00
Get image data READ FBUF 56 00 32 0C 00 76 00 32 00 FF Get image data starting Image size Get image size xx xx xx xx (P4)