为什么没有任何反应
Closed this issue · 27 comments
Sorry I can't read chinese.
What's the issue?
Do you have a wiring diagram for all the pins, such as pwdn,rst. I wired according to your code and ran it in arduino due without any reaction
Ah! OK!
I don't have the wired Arduino here where I live, but in the next days I can go to my lab to check if I disassembled the wiring. I'll check and make some photos.
Anyway, the wiring is defined in the first part of the sketch. For example #define PCLK 32 means that you have to wire the pin PCLK on the cam to pin 32 on the Arduino. To speed up the image capturing, the pins I chose are all from the PortC bus, Arduino's digitalRead() function is too slow for the cam, so I have to read the bus directly from the register. Be aware of that if you change the pins within the defines.
Remember also that the OV7670 is wired to the I²C, if you're using a Due or similar you have to connect SDA on the Arduino to SIOD on the cam and SCL on the Arduino to SIOC on the cam. You can check if you wired it correctly with the I²C tester sketch in the Arduino IDE's example. IIRC HREF pin is not used.
Another thing: Due has two USB. One is for programming and the other for communication. The sketch uses the second, because the programming one is too slow.
If you set up everything correctly, the two python scripts can help you to decode the image and write a file, or see it live with the tkinter interface. You can just check if the Arduino is doing something just opening the serial with screen, putty or the embedded program in the Arduino IDE. You should see some bytes flowing.
I haven't checked this project for a long time, so I can't be really helpful, sorry :(
Thank you for your reply. As a beginner, I am looking for some cases of arduino due connecting ov7670, but I find such examples are too few. I should have all the wiring correct according to what you said. If you have time to verify that your code can work, I will be more motivated to stick to this work. Thank you for your serious reply, which will also be part of my motivation to move forward
OK I found the project... disassembled. I tried to rewire but it's not working right now. It just sends a lot of REG ERROR 0xnn. It seems that something is wrong with the I²C communication.
I almost forgot that you have to put two pull up resistors as the cam board (at least, my board) doesn't provide them. They are two 4.7k or 10k resistors that connect SDA and SCL to +3.3v.
I'm excited to see your images.
Or can I add your contact info and ask you a question, I'd appreciate it!
Maybe I can help you if you show me your wiring.
I have read your wiring, why is it different from the wiring method in arduino.due?
pwdn and href are not connected
I observe the code logic, it seems that this is successful, but I do not see the output image, how should I output the image captured by the camera
I found that during the run, my SerialUSB.available() was always equal to 0, so I couldn't get into the if, so I couldn't capture the image
Am I supposed to type something into the console? Please forgive me so many questions, I am really the first contact with hardware, a little don't know what to do
READY is a good result, it means that the I²C is working. Also it's transmitting something, albeit not the intended image, but it's transmitting. Usually I tended to get this kind of results at the beginning, when I misunderstood how the SYNCs work.
The console (the one in the tkinter python script) can be used to check the value or write a value into the registers. By altering the values you can change, for example, the brightness etc. the full list is in the datasheet:
https://www.electronicscomp.com/datasheet/ov7670-sensor-datasheet.pdf
Sorry I completely forgot PWDN, it should be connected with GND or to a PIN that is down. It's used to place the cam in standby (1=standby, 0=on).
I'm going to update the README.md now.
Sure, you can "follow" me on github. Be aware that I'm not a super-expert anyway.
Can I mark the issue as "resolved"?