psoc1 I2C to arduino

Hi ,

I have a big problem.Before,I wrote about this subject to forum but i didn’t get answer. I try to psoc1 to arduino I2C.

How to comminicate with the following program arduino? I think to use wire.h slave_receiver. But i don’t know how to write code slave_receiver.Waiting for help thank you…

#include <m8c.h>
#include “PSoCAPI.h”
#include “psocgpioint.h”
#include “main.h”
#include “display.h”

I2C_REGS SRegInfo;

void main(void)
{
// Enable global interrupts
M8C_EnableGInt;

ClearAllLEDs();

// I2C initialization

// Set the location and size of the RAM buffer. It is required to call
// this function before calling EzI2Cs_Start().
EzI2Cs_SetRamBuffer(sizeof(SRegInfo), 1, (BYTE *) &SRegInfo);

// Initialize I2C and enable I2C interrupts
EzI2Cs_Start();

SRegInfo.bSensorID = 0; //On reset store 0 as sensor id

// Capsense initialization

CSD_Start();

CSD_InitializeBaselines();

// Set finger thresholds according to parameter value
CSD_SetDefaultFingerThresholds();

while (1)
{

// Scan each CapSense sensor
CSD_ScanAllSensors();

// Update sensor baseline
CSD_UpdateAllBaselines();

// Check for on/off state of each sensor
// Return value of 1 if active, 0 if not active
CSD_bIsAnySensorActive();

// Update sensor data registers
UpdateI2CBuffer();

// Display slider position and button state
SetSliderButtonStatusAndUpdateLEDs(SRegInfo.bSliderPos, CSD_baSnsOnMask[0]);
}
}

void UpdateI2CBuffer(void)
{

M8C_DisableGInt;

SRegInfo.wSensorRawCount = CSD_waSnsResult[SRegInfo.bSensorID];

SRegInfo.wSensorBaselineCount = CSD_waSnsBaseline[SRegInfo.bSensorID];

SRegInfo.wSensorDifferenceCount = CSD_waSnsDiff[SRegInfo.bSensorID];

SRegInfo.wSensorMaskInfo = CSD_baSnsOnMask[1];
SRegInfo.wSensorMaskInfo = SRegInfo.wSensorMaskInfo << 8 ;
SRegInfo.wSensorMaskInfo |= CSD_baSnsOnMask[0];

if( ( CSD_baSnsOnMask[0] & BUTTON_MASK ) != 0x00 )
{
if(CSD_baSnsOnMask[0] & BUTTON0_MASK)
{
SRegInfo.bPhysicalButtonNum = 0x00;
LED_ON(Digital1_Data_ADDR, Digital1_MASK);
}

}

else
{
// Store NO_FINGER as default data if button is not active
SRegInfo.bPhysicalButtonNum = NO_FINGER;
}

// Get slider position, validate and store the data into I2C buffer.
SRegInfo.bSliderPos = (BYTE)CSD_wGetCentroidPos(1);
if (SRegInfo.bSliderPos == NO_FINGER)
{
// Store ‘0’ as default data if slider is not active
SRegInfo.bSliderPos = NO_FINGER_PRESENT;
}

M8C_EnableGInt;
}

No one answered your question yet. I think not many people use it with the Arduino. Can you provide links to what it is, and where you have the code from ? Can you place your code between code tags ? (if you post a message, above the text input field is a '#'-button, that button is for the code tags). You can modify your first post.

Is this your PSoC 1, http://www.cypress.com/?id=1573 ?

Is your PCoC 1 programmed with code/firmware ? Which code ?

How is it connected, can you upload a photo ? Which Arduino board are you using ?

What is your question ? Do you want the Arduino to request data from the PSoC 1 via I2C ? Or do you want the Arduino to be a I2C slave for the PSoC 1 ?