Usual questions: Pullup resistors on SDA and SCL? VDDIO tied high?? Component initialized using I2C_Start() API???
#2 Don;t know how to tell from the schematic. Pretty sure it is. The spec says so
Attached is the part of the schematic where VDDIO is mentioned
Sorry can't divulge any more due to IP restrictions
#3 The code calls a generated routine Accel_Start() routine
The comment there says " After this function call, the component is enabled and ready for operation."
So I'm pretty sure the answer is yes
Also what about the INT1 and INT2?
On the schematic they are shown to be assigned to pins 6 and 9 of the CYBLE.
How do I connect them in PSoC?
accell.png 25.4 K
We come to the "INT1" and "INT2" later (probably pure input pins, may get configured to interrupt the PSoC)
At first you should get the I2C to work. Verify in Creator pin view that the ports P1 and P1 are connected to scl and sda respectively.
For testing purposes: use
Set compiler optimization to "none"
Status = Accel_I2CMasterSendStart(0x1d,1);
and check Status for non-zero (error).
Duh. I forgot to add CyGlobalIntEnable..
It's working now.
On to the next problem :)
Thanks for your help!
Would appreciate some help setting up the INT1 and INT2 pins..
You may read the INT pins directly and act upon in software, so just configure the pin as digital input,high Z, no hw connection.
Is there a sample code/project you can point me to?
Sorry for newbie questions
1 of 1 people found this helpful
The INTn pins function of the accelerometer are programmable, so it is up to you to decide whether you need them and if, what event is connected to them. Clearing the line on the 8653 must be done which needs some effort.
It is your decision as well, to select on PSoC side between a polled (frequently checked) input or an interrupt raised. I would start with a polled input: Setup the pins as I described in my previous post, then in the main loop check the pins using Pinname_Read() API (see pin documentation) and act accordingly as:
if(INT1_Read()) HandleInt1(); // INT1 pin was raised, clear interrupt and do the job
Thank you Bob,your help is much appreciated.