- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
I have a board module with cy8c9560a with two LEDs connected to GPIO PORT 0. I am trying to configure them from atmel board using I2C. Can you please tell me the baic steps to be followed like.
1. start condition
2. which slave address ?
3. next which register address ? or before this step do i need to configure the pins as output pins
4. . .clock setting ?
I read the data sheet , i'm confused to how to start.
Please give me inputs.
Thanks and regards
R Madhu.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhu,
To know the slave address for this device, you have to read the Extendable Soft Addressing on page 9 in the datasheet.
Next you have to write to the Port Select Register (18h) with 0 (for GPIO Port0).
Then you have to write the Pin Direction Register (1ch) with the bit numbers which are connected to LEDs as 0 (output) and the rest as 1 (input)
Then you have to write to the Output Port 0 Register (08h) with the values for the LEDs to turn them on or off.
Attach the schematic of your module board, so that I may assist you in getting the slave address.
Sampath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Madhu,
To know the slave address for this device, you have to read the Extendable Soft Addressing on page 9 in the datasheet.
Next you have to write to the Port Select Register (18h) with 0 (for GPIO Port0).
Then you have to write the Pin Direction Register (1ch) with the bit numbers which are connected to LEDs as 0 (output) and the rest as 1 (input)
Then you have to write to the Output Port 0 Register (08h) with the values for the LEDs to turn them on or off.
Attach the schematic of your module board, so that I may assist you in getting the slave address.
Sampath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Sampath,
However, now iam able to communicate with the Cypress from my Atmel Controller.
These steps i followed.
Selecting the SLAVE address as 0x21 for IO expander without read/write bit(since my API is taking care of R/W bits).
Next i wrote Register address 0x08 , to select Port 0 , and followed by 0x00 to make all pins Low , to blink the LEDs.
For reading also i taken 0x2e register , the device ID of Cypress 0x60h.
Atmel studio provided the Ready APIs to make my work easier, It is important to understand the APIs design.
Thanks & Regards,
R Madhu.