Skip to content
This repository has been archived by the owner on Jun 15, 2020. It is now read-only.

Why fix bit_num=3 and duty=4 in camera.c ? #5

Closed
liubenyuan opened this issue Dec 1, 2016 · 2 comments
Closed

Why fix bit_num=3 and duty=4 in camera.c ? #5

liubenyuan opened this issue Dec 1, 2016 · 2 comments

Comments

@liubenyuan
Copy link

These configuration will fail if I set xclk frequency to 16MHz.

@krzychb
Copy link
Collaborator

krzychb commented Dec 1, 2016

Yes, it will fail because for 16MHz you can not get duty cycle precision of 3 bits. You can get max. 2 bits.

In short xclk is obtained by dividing 80MHz internal clock. This clock can effectively count up to five (80MHz / 16MHz = 5). This limits precision of duty cycle. There is a picture in Technical Reference Manual in chapter "6.2.3 Channels" explaining how certain duty cycle is achieved.

Also, if you download latest esp-idf, besides failure message, you will also get explanation like: requested frequency and bit depth can not be achieved, try reducing freq_hz or bit_num.

@liubenyuan
Copy link
Author

Thanks, I will read that manual.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants