Comments (4)
Thank you for the report with detailed information. I actually had an similar issue with SCCB read operaion, but write operation was okay in my environment. So, there might be something depending on device.
My workaround for read operation is to use HAL_I2C_Master_Transmit instead of HAL_I2C_Mem_Read and communicate with the sensor byte by byte, so that STM32 doesn't care ack/nack.
I think the same solution will work for write operation. I will give it a try next week. (I'm on vacation this week, sorry!)
BTW, do you supply MCLK to the sensor? (I use MCO in my project). Otherwise, the sensor doesn't work at all, then your analyser might consider it as NACK. (You said the address part was working, so I think it must be okay, though.)
from digitalcamera_stm32.
Making progress - I had the PWRDN signal the wrong way up which caused the camera to be asleep all the time.
SCCB now works correctly, just trying to get sync to work (I'm not using all your code, just the parts I feel are necessary to prove the camera works OK).
More info - I had to reduce MCLK from 42MHz to 16MHz (derived from HSI) as frame rate was 51 fps which is outside spec for OV7670 (30fps max). I'm finding it difficult to get the registers set correctly - the documentation is very confusing!
from digitalcamera_stm32.
That's good. SCCB communication problem was just because of wrong PWRDN signal.
You can refer to br_lesson branch (https://github.com/take-iwiw/DigitalCamera_STM32/tree/br_lesson). This is a simple implementation of ov7670 driver and live view function.
When AGC enabled, fps may vary depending on brightness.
I recommend you take a look at OV7670 driver on Linux, and OV7670 Implementation Guide (not a datasheet). They are useful.
from digitalcamera_stm32.
@iwatake2222 I'm facing the same issue as described above. However, in my case, both the HAL_I2C_Mem_Write
and HAL_I2C_Master_Transmit
are failing while reaching the I2C_WaitOnMasterAddressFlagUntilTimeout
One thing to note here is that I'm not getting a timeout failure, rather a acknowledge failure in the below snippet:
while (__HAL_I2C_GET_FLAG(hi2c, Flag) == RESET)
{
if (__HAL_I2C_GET_FLAG(hi2c, I2C_FLAG_AF) == SET) <--- Fulfills this if condition
{
/* Generate Stop */
SET_BIT(hi2c->Instance->CR1, I2C_CR1_STOP);
/* Clear AF Flag */
__HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF);
hi2c->PreviousState = I2C_STATE_NONE;
hi2c->State = HAL_I2C_STATE_READY;
hi2c->Mode = HAL_I2C_MODE_NONE;
hi2c->ErrorCode |= HAL_I2C_ERROR_AF;
/* Process Unlocked */
__HAL_UNLOCK(hi2c);
return HAL_ERROR; <----- Fails here
}
....
}
from digitalcamera_stm32.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from digitalcamera_stm32.