当前位置: 代码迷 >> 综合 >> OV3640-VGA预览初始化寄存器配置
  详细解决方案

OV3640-VGA预览初始化寄存器配置

热度:66   发布时间:2023-09-20 12:40:18.0

1、寄存器初始化配置说明:

VGA大小(640*480)、YUV422格式(YVYU顺序)、15fps

static uint16_t ov3640_15fps_VGA[][2] = {
    /*{0x3012, 0x80},复位需要延时一段时间*/{
    0x304d, 0x45}, {
    0x30a7, 0x5e}, {
    0x3087, 0x16},{
    0x309c, 0x1a}, {
    0x30a2, 0xe4}, {
    0x30aa, 0x42}, {
    0x30b0, 0xff}, {
    0x30b1, 0xff}, {
    0x30b2, 0x10},{
    0x300e, 0x32}, {
    0x300f, 0x21}, {
    0x3010, 0x20}, {
    0x3011, 0x04}, {
    0x304c, 0x81}, {
    0x30d7, 0x10}, {
    0x30d9, 0x0d}, {
    0x30db, 0x08}, {
    0x3016, 0x82}, {
    0x3018, 0x38}, {
    0x3019, 0x30}, {
    0x301a, 0x61}, {
    0x307d, 0x00}, {
    0x3087, 0x02}, {
    0x3082, 0x20}, {
    0x3015, 0x12}, {
    0x3014, 0x04}, {
    0x3013, 0xf7}, {
    0x303c, 0x08}, {
    0x303d, 0x18}, {
    0x303e, 0x06}, {
    0x303f, 0x0c}, {
    0x3030, 0x62}, {
    0x3031, 0x26}, {
    0x3032, 0xe6}, {
    0x3033, 0x6e}, {
    0x3034, 0xea}, {
    0x3035, 0xae}, {
    0x3036, 0xa6}, {
    0x3037, 0x6a}, {
    0x3104, 0x02}, {
    0x3105, 0xfd}, {
    0x3106, 0x00}, {
    0x3107, 0xff}, {
    0x3300, 0x12}, {
    0x3301, 0xde}, {
    0x3302, 0xef}, {
    0x336a, 0x52}, {
    0x3370, 0x46},{
    0x3376, 0x38}, {
    0x3300, 0x13}, {
    0x30b8, 0x20}, {
    0x30b9, 0x17}, {
    0x30ba, 0x04}, {
    0x30bb, 0x08}, {
    0x3507, 0x06}, {
    0x350a, 0x4f}, {
    0x3100, 0x02}, {
    0x3301, 0xde}, {
    0x3304, 0x00}, {
    0x3400, 0x00}, {
    0x3404, 0x00}, {
    0x335f, 0x68}, {
    0x3360, 0x18},{
    0x3361, 0x0c}, {
    0x3362, 0x12}, {
    0x3363, 0x88}, {
    0x3364, 0xe4}, {
    0x3403, 0x42}, {
    0x3088, 0x02}, {
    0x3089, 0x80}, {
    0x308a, 0x01}, {
    0x308b, 0xe0}, {
    0x308d, 0x04}, {
    0x3086, 0x03}, {
    0x3086, 0x00}, {
    0x3011, 0x01}, {
    0x304c, 0x85}, {
    0x3300, 0x13},{
    0x3367, 0x34}, {
    0x3368, 0x44}, {
    0x3369, 0x00}, {
    0x336A, 0x3F}, {
    0x336B, 0x07}, {
    0x336C, 0x00}, {
    0x336D, 0x34}, {
    0x336E, 0x5E}, {
    0x336F, 0x00}, {
    0x3370, 0x37}, {
    0x3371, 0x07}, {
    0x3372, 0x00}, {
    0x3373, 0x34}, {
    0x3374, 0x56}, {
    0x3375, 0x20}, {
    0x3376, 0x34}, {
    0x3377, 0x07}, {
    0x3378, 0x00}, {
    0x3317, 0x04}, {
    0x3316, 0xf8}, {
    0x3312, 0x0f}, {
    0x3314, 0x23}, {
    0x3313, 0x1f}, {
    0x3315, 0x33}, {
    0x3311, 0xb1}, {
    0x3310, 0xda}, {
    0x330c, 0x18}, {
    0x330d, 0x18}, {
    0x330e, 0x4c}, {
    0x330f, 0x6a}, {
    0x330b, 0x1c}, {
    0x3306, 0x5c}, {
    0x3307, 0x11}, {
    0x3308, 0x25}, {
    0x3340, 0x0E}, {
    0x3341, 0x4D}, {
    0x3342, 0x2C}, {
    0x3343, 0x2C}, {
    0x3344, 0x8A}, {
    0x3345, 0xB4}, {
    0x3346, 0xAA}, {
    0x3347, 0xB6}, {
    0x3348, 0x0C}, {
    0x3349, 0x98}, {
    0x333F, 0x04}, {
    0x3355, 0x02}, {
    0x3358, 0x46}, {
    0x3359, 0x46}, {
    0x331b, 0x08}, {
    0x331c, 0x16}, {
    0x331d, 0x2d}, {
    0x331e, 0x54}, {
    0x331f, 0x66}, {
    0x3320, 0x73}, {
    0x3321, 0x80}, {
    0x3322, 0x8c}, {
    0x3323, 0x95}, {
    0x3324, 0x9d}, {
    0x3325, 0xac}, {
    0x3326, 0xb8}, {
    0x3327, 0xcc}, {
    0x3328, 0xdd}, {
    0x3329, 0xee}, {
    0x332a, 0x1d}, {
    0x3018, 0x40}, {
    0x3019, 0x38}, {
    0x332e, 0x04}, {
    0x332f, 0x04}, {
    0x3331, 0x02}, {
    0x3014, 0x84}, {
    0x3013, 0xe7}, {
    0x3070, 0x00}, {
    0x3071, 0xeb}, {
    0x3072, 0x00}, {
    0x3073, 0xc4}, {
    0x301c, 0x05}, {
    0x301d, 0x06},
};

2、初始化代码

void OV3640_Reset(void)
{
    OV3640_WriteReg(0x3012, 0x80);
}void OV3640_VGAConfig(void)
{
    uint32_t i;unsigned short sensor_reg = 0;/*摄像头复位*/OV3640_Reset();HAL_Delay(50);for(i=0; i<(sizeof(ov3640_15fps_VGA)/4); i++){
    OV3640_WriteReg(ov3640_15fps_VGA[i][0], ov3640_15fps_VGA[i][1]);HAL_Delay(10);sensor_reg = OV3640_ReadReg(ov3640_15fps_VGA[i][0]);if(ov3640_15fps_VGA[i][1] !=sensor_reg){
    printf("init err\r\n"); }}printf("OV3640_VGAConfig\r\n");
}