ArduChip is the core of the ArduCAM, which incoperates a Altera MAXII CPLD EPM240 as main processor. The main task of the ArduChip is do the real time DMA transfer between Camera module and the 3.2″ LCD and act as Arduino, Camera and LCD bus multiplexer. It also provides AVR like GPIO expansion, it can be set as input or output and resolve the problem of limited IO resources in Arduino board. The GPIOs can be used as event trigger in and trigger out. 

AddressNameModeDescription
0x00DDRR/WData Direction RegisterBit[7:6]: ReservedBit[5]: IO5 input/output selectionBit[4]: IO4 input/output selectionBit[3]: IO3 input/output selectionBit[2]: IO2 input/output selectionBit[1]: IO1 input/output selectionBit[0]: IO0 input/output selection1 = output, 0 = input
0x01PORTR/WOutputPortRegisterThe value will reflect on the Pin IO0~IO6 correspondinglyBit[7:6]: ReservedBit[5]: IO5 output valueBit[4]: IO4 output valueBit[3]: IO3 output valueBit[2]: IO2 output valueBit[1]: IO1 output valueBit[0]: IO0 output value1 = High, 0 = Low
0x03MODER/WBus ModeDetermine who is owner of the data bus, only one owner is allowed.Bit[7:3]: ReservedBit[2]: MCU read LCD busBit[1]: Camera write LCD busBit[0]: MCU write LCD bus
0x80PINROInput Pin RegisterThe value will reflect the IO0~IO6 Pin status correspondinglyBit[7:6]: ReservedBit[5]: IO5 input valueBit[4]: IO4 input valueBit[3]: IO3 input valueBit[2]: IO2 input valueBit[1]: IO1 input valueBit[0]: IO0 input value1 = High, 0 = Low
0x81TriggerROTrigger input RegisterBit[7:2]: ReservedBit[1]: Capture button status, 0 = pressed, 1 = releasedBit[0]: Frame start signal, equal to VSYNC
0x82Revision IDROBit[7:6]: Revision integer partBit[5:0]: Revision decimal partFirst revision released ID is 0x40, means V1.00

Examples:

ArduCAM GPIO Write demo

// ArduCAM GPIO Write demo (C)2012 Lee
// web: http://www.ArduCAM.com
// This program is a demo of how to use GPIOs in ArduCAM to turn on/off
// LEDs or trigger any ohter devices.
//
// This program requires the ArduCAM library.
//
#include <Wire.h>
#include <ArduCAM.h>
#include <avr/pgmspace.h>
#include <SoftwareSerial.h>

#define ARDUCHIP_DDR       0x00  //GPIO direction register
#define ARDUCHIP_PORT      0x01  //GPIO output register
#define ARDUCHIP_PIN       0x80  //GPIO input register
//ArduCAM(byte model,int RS, int WR, int RD, int CS)
ArduCAM myCAM(OV7670,A2,A1,A0,A3);
//Uncomment if use software serial
SoftwareSerial mySerial(8, 9); // RX, TX
void setup()
{
  mySerial.begin(9600);
  mySerial.println("hello");
  myCAM.write_reg( ARDUCHIP_DDR, 0xff);     //Set GPIO as output

}

void loop()
{
  uint8_t val = 0xff;
  uint8_t read_val;
  while(1)
  {
    delay(1000);
    myCAM.write_reg( ARDUCHIP_PORT, val);       //Output Register
    val = val ^ 0xff;                           //toggle output value
    read_val = myCAM.read_reg(ARDUCHIP_PORT);   //Read it back
    mySerial.write(read_val);
  }
  return;

}

ArduCAM GPIO Read demo

// ArduCAM GPIO Read demo (C)2012 Lee
// web: http://www.ArduCAM.com
// This program is a demo of how to use GPIOs in ArduCAM to read 
// trigger signals from any ohter devices.
//
// This program requires the ArduCAM library.
//
#include <Wire.h>
#include <ArduCAM.h>
#include <avr/pgmspace.h>
#include <SoftwareSerial.h>

#define ARDUCHIP_DDR       0x00  //GPIO direction register
#define ARDUCHIP_PORT      0x01  //GPIO output register
#define ARDUCHIP_PIN       0x80  //GPIO input register

//ArduCAM(byte model,int RS, int WR, int RD, int CS)
ArduCAM myCAM(OV7670,A2,A1,A0,A3);
//Uncomment if use software serial
SoftwareSerial mySerial(8, 9); // RX, TX
void setup()
{
  mySerial.begin(9600);
  mySerial.println("hello");
  myCAM.write_reg( ARDUCHIP_DDR, 0x00);     //Set GPIO as input
}

void loop()
{
  uint8_t temp;
  while(1)
  {
    temp = myCAM.read_reg(ARDUCHIP_PIN);      //Read from GPIO
    mySerial.write(temp);                  //Send value read from GPIO
    delay(1000);
  }
  return;

}

 

0
Your Cart is empty!

It looks like you haven't added any items to your cart yet.

Browse Products