Arducam library!

Yes, just as any other pinMode(TX, INPUT); and pinMode(RX, INPUT);
This is also what my ancient ExtTinker App and firmware added as one of the extra features :wink:

And this order (A0 is bit 0)

(Edit: had TX/RX swapped)

1 Like

@kennethlimcp, @ScruffR is correct about the way to set INPUT mode. Call pinMode() also configures the PIN_MAP[] structure correctly whereas a direct GPIO register setup will not. :smile:

1 Like

Just to safe you some rewiring with your Photons too, I just looked into the pin mapping there and found that it would be doable with some little drawbacks.
You would need to give up the RGB LED and use its solder pads at the bottom of the Photon, than you could use
WKP/A7 ; RGB R ; RGB G ; RGB B ; DAC/A6 ; A3 ; A4 ; A5 as bits 0 ā€¦ 7 on GPIOA :smile:

1 Like

@kennethlimcp, @ScruffR is right but you can still gain considerable performance even if you split the bits over two ports as two nibbles.

BTW, @ScruffR, what we need for both the Core and the Photon is a pin mapping diagram! The STM32_Pin_Info PIN_MAP[] in spark_wiring.cpp lacks information. Have you put something like that together cause that should absolutely be in the hardware docs?

@peekay123, no I havenā€™t but so far I always used the Core diagram which is already in the docs and for the Photon I use this

@ScruffR,

I just did a bit by bit test and the RX and TX you mentioned for the GPIOA is swappedā€¦

It should be A0,A1,TX,RX,A2,A3,A4,A5 :wink:

I just realized that the image you linked to has the TX RX labeled on the wrong pins and that explains why. Have to grab my trusty old soldering iron out since iā€™m at home for the weekend!

Sorry for that :blush:

2 Likes

@kennethlimcp any good news? :slight_smile:

Hey @Clorofilla,

I only managed to get I2C working.

Data came in somehow but kinda corrupted. I will recommend the FIFO version but it still takes too much pins! Hopefully I can design a low cost version with an M0 mcu to do the processing instead.

Will update here when I make progress! Thereā€™s always cons when you try to go cheapā€¦ too many I/Os to get this working

any update on this @kennethlimcp?

Sorry but i didnā€™t work on it :smile:

@kennethlimcp @peekay123 @develamit @leo3linbeck
If it helps at all, hereā€™s the code from the book ā€œBeginning Arduino with OV7670ā€:
http://www.psycho-sphere.com/BeginningArduinoov7670CameraDevelopment.zip

This code takes images and saves them to SD card, so no need for an LED display or Serial. It uses the OV7670 with FIFO memory chip, and a generic Arduino-compatible SD card reader. It uses the Arduino library ā€œWire.hā€ to set registers over I2C and connects to SD over SPI.

Iā€™m so eager to use my new Photon with the camera that, hell, Iā€™d pay with my summer savings for someone to port this code / library over.

1 Like

This library might pose some problem since it uses (at least) 15 pins, leaving only three (1 standard + RX/TX) on the Photon/Core for other things.
But apart from that it looks doable (for someone with time and a device to test the port).

Could you help me troubleshoot my code? Itā€™s at https://github.com/AwesomeShayne/CamerAzure/blob/dev/DeepDishCamera

What are the issues you see - to shoot something, Iā€™d need to see it :wink:

It compiles and flashes, but no results. Iā€™m just trying to stream the individual pixel data as numbers to Serial. But when I open up Serial Monitor on my command line, none of the Serial.print debugging statements show up, from initializing to setting registers to sending image dataā€¦

Does your Photon reach cyan breathing state?
Have you got pull-up resistors in place for the I2C interface (D0,D1)?

Can you try your serial output with a stripped down version that maybe just returns from setup() after Serial and Wire initialization and also a very rudimentary loop() like this

void loop()
{
  Serial.println(millis());
  delay(500);
  return;
  // keep your original code after this
  ...
}

And then just push your return; lines further and further down to see where things start playing up.

1 Like

I answered another thread just nowā€“letā€™s stick to one thread please since the elites mostly read all thread.

Some people are still reporting i2c problems in 0.4.7 but most people have working i2c. Hard to know if that is contributing here.

I would try to get the simplest response from the camera (some status) and report that over serial before trying anything else.

1 Like

Just to join the two threads
Camera Module (Has anyone done the hard work yet)

1 Like

Sorry about double posting! I will stick to posting in this thread.
Yes the Photon is cyan breathing, though only at my home network b/c the university networks donā€™t get connected to or require fields to be filled out.
The cameraā€™s I2C are 3.3Vm so I donā€™t need pull-ups from the Photon right? I needed them for my old Arduino which was 5V.

There is also a bug where my photon may flash green rapidly when the camera is plugged in (I2C, a few analog pins, and all the digital pins). When I disconnect the camera, it then resumes cyan breathing, so it leads me to think somethingā€™s wrong with connecting when itā€™s plugged in.

Iā€™ve added the debugging print statements and returns to both void setup and void loop, but nothing. I guess I will go through each helper functions and comment them out to test this.