1.Which seller did you purchase the product(s) from?
Amazon
2.The Model number of the product(s) you have purchased?
Arducam Mini Module Camera Shield with OV2640 2 Megapixels
3.Which Platform are you using the product(s) on?
STM32F746G
4.Which instruction are you following?
https://github.com/ArduCAM/STM32
5.Has your product ever worked properly?
Never Worked
6.What problems are you experiencing?
I am just compiled the code in my STM32F746G platform and I can read and write to the I2C and SPI registers. Now I want to do a single Capture BMP transfer to buffer memory, but I don’t get the BMP data. Basically I have one simple question following the code in https://github.com/ArduCAM/STM32.
In the “main.c” after the case 0x30 that sets up the Arducmap ov2640 in BMP mode. if you look at the code all the way below where a single capture is selected. The function calls out:
StartBMPcapturer();
The definition of this is in “spi.c” the function definition StartBMPcapturer() everthing seems normal except where the VH (Video High) and VL (Video Low) values are read from the SPI register by the function:
VH = SPI2_ReadWriteByte(0x00);
VL = SPI2_ReadWriteByte(0x00);
The definition of the SPI2_ReadWriteByte(0x00) is in “spi.c” file and exactly which SPI register address is the Video address being read from? It can’t be 0x00,because this is defined as “Test Register” in the “2MP SPI Camera Hardware Application Note”.
Here is the “StartBMPcapturer()” code in “spi.c” below.
void StartBMPcapture(void)
{
flush_fifo();
clear_fifo_flag();
start_capture();
while(!get_bit(ARDUCHIP_TRIG , CAP_DONE_MASK)){;}
//printf(“ACK CMD capture done\r\n”);
length= read_fifo_length();
// printf(“ACK CMD the length is %d\r\n”,length);
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);
USART_SendData(USART1, 0xff);
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);
USART_SendData(USART1, 0xaa);
for(int temp = 0; temp < BMPIMAGEOFFSET; temp++)
{
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);
USART_SendData(USART1, pgm_read_byte(&bmp_header[temp]));
}
CS_LOW();
set_fifo_burst();
char VH, VL;
int i = 0, j = 0;
for (i = 0; i < 240; i++)
{
for (j = 0; j < 320; j++)
{
VH = SPI2_ReadWriteByte(0x00);
VL = SPI2_ReadWriteByte(0x00);
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);
USART_SendData(USART1, VL);
delay_us(15);
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);
USART_SendData(USART1, VH);
delay_us(15);
}
}
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);
USART_SendData(USART1, 0xbb);
delay_us(12);
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET);
USART_SendData(USART1, 0xcc);
CS_HIGH();
}
Thanks!
7.What attempts at troubleshooting have you already made?
8.How would you like us to help you?
Could you explain which SPI register I need to read the Video 16 bit RGB values from?