![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Test Code for OV7670 Camera module with FIFO AL422
Dependencies: MODSERIAL mbed ov7670
You can find more information in this page: https://mbed.org/users/edodm85/notebook/ov7670-camera-module/
main.h@0:19429e334b75, 2013-03-10 (annotated)
- Committer:
- edodm85
- Date:
- Sun Mar 10 13:03:52 2013 +0000
- Revision:
- 0:19429e334b75
- Child:
- 2:bbd557817319
First Version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
edodm85 | 0:19429e334b75 | 1 | #pragma once |
edodm85 | 0:19429e334b75 | 2 | #include "mbed.h" |
edodm85 | 0:19429e334b75 | 3 | #include "ov7670.h" |
edodm85 | 0:19429e334b75 | 4 | #include "MODSERIAL.h" |
edodm85 | 0:19429e334b75 | 5 | |
edodm85 | 0:19429e334b75 | 6 | |
edodm85 | 0:19429e334b75 | 7 | |
edodm85 | 0:19429e334b75 | 8 | MODSERIAL pc(USBTX,USBRX); |
edodm85 | 0:19429e334b75 | 9 | Timer t; |
edodm85 | 0:19429e334b75 | 10 | bool new_send = false; |
edodm85 | 0:19429e334b75 | 11 | |
edodm85 | 0:19429e334b75 | 12 | DigitalOut led1(LED1); |
edodm85 | 0:19429e334b75 | 13 | DigitalOut led2(LED2); |
edodm85 | 0:19429e334b75 | 14 | DigitalOut led3(LED3); |
edodm85 | 0:19429e334b75 | 15 | DigitalOut led4(LED4); |
edodm85 | 0:19429e334b75 | 16 | |
edodm85 | 0:19429e334b75 | 17 | |
edodm85 | 0:19429e334b75 | 18 | //Camera |
edodm85 | 0:19429e334b75 | 19 | #define SIZEX (160) |
edodm85 | 0:19429e334b75 | 20 | #define SIZEY (120) |
edodm85 | 0:19429e334b75 | 21 | #define SIZE (SIZEX*SIZEY) |
edodm85 | 0:19429e334b75 | 22 | |
edodm85 | 0:19429e334b75 | 23 | OV7670 camera |
edodm85 | 0:19429e334b75 | 24 | ( |
edodm85 | 0:19429e334b75 | 25 | p28,p27, // SDA,SCL(I2C / SCCB) |
edodm85 | 0:19429e334b75 | 26 | p23,p24,p25, // VSYNC,HREF,WEN(FIFO) |
edodm85 | 0:19429e334b75 | 27 | Port0,0x07878000, // PortIn data p18(P0.26),p17(P0.25),p16(P0.24),p15(P0.23),p11(P0.18),p12(P0.17),p14(P0.16),p13(P0.15) |
edodm85 | 0:19429e334b75 | 28 | p26,p29,p30 // RRST,OE,RCLK |
edodm85 | 0:19429e334b75 | 29 | ); |
edodm85 | 0:19429e334b75 | 30 | |
edodm85 | 0:19429e334b75 | 31 | unsigned char bank0 [SIZE]; |
edodm85 | 0:19429e334b75 | 32 | unsigned char *bank1 = (unsigned char *)(0x2007C000); |
edodm85 | 0:19429e334b75 | 33 | |
edodm85 | 0:19429e334b75 | 34 | //RESET |
edodm85 | 0:19429e334b75 | 35 | extern "C" void mbed_reset(); |
edodm85 | 0:19429e334b75 | 36 | |
edodm85 | 0:19429e334b75 | 37 | //Serial |
edodm85 | 0:19429e334b75 | 38 | char word[8]; |
edodm85 | 0:19429e334b75 | 39 | int t1 = 0; |
edodm85 | 0:19429e334b75 | 40 | int t2 = 0; |
edodm85 | 0:19429e334b75 | 41 | int t3 = 0; |
edodm85 | 0:19429e334b75 | 42 | |
edodm85 | 0:19429e334b75 | 43 | // |
edodm85 | 0:19429e334b75 | 44 | void parse_cmd(); |
edodm85 | 0:19429e334b75 | 45 | void CameraSnap(char c); |
edodm85 | 0:19429e334b75 | 46 | void CameraGrab(); |