How to generate read address?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
doch_3739346
Level 4
Level 4

Hi,

By referencing SRAMMaster example, I've created a simple register read/write project.

Please note, I've swapped write initial state name (START) with read initial state (RD_START), since don't know how to start the read flow.

Like the example, I'm using AddressCounter as address source.

It's "working", but start address is tied to 0.

How can I set start address to any 32 bits value?

pastedImage_0.png

pastedImage_1.png

0 Likes
1 Solution
alamandaa_16
Moderator
Moderator
Moderator
10 likes received First like received

Hello Dong Chen,

--CyU3PGpifInitAddrCounter funtion is used in the firmware to configure the GPIF LD_ADDR_COUNT with the desired initial value, limit and counting mode.

This API should be called after GPIFLoad and before GPIFStart in the Firmware.

example : if you want to set start address to 10 and address limit to 255, you should set the initial value,limit and incerement value using following API.

void CyU3PGpifInitAddrCounter ( uint32_t initValue, uint32_t limit, CyBool_t reload, CyBool_t upCount, uint8_t increment )

                   uint32_t initValue  = 0x0000000A

                   uint32_t limit         = 0x000000FF

                   CyBool_t reload    = CyTrue

                   CyBool_t upCount = CyTrue

                  uint8_t increment   = 0x01        

Regards,

Anil Srinivas.

View solution in original post

0 Likes
1 Reply
alamandaa_16
Moderator
Moderator
Moderator
10 likes received First like received

Hello Dong Chen,

--CyU3PGpifInitAddrCounter funtion is used in the firmware to configure the GPIF LD_ADDR_COUNT with the desired initial value, limit and counting mode.

This API should be called after GPIFLoad and before GPIFStart in the Firmware.

example : if you want to set start address to 10 and address limit to 255, you should set the initial value,limit and incerement value using following API.

void CyU3PGpifInitAddrCounter ( uint32_t initValue, uint32_t limit, CyBool_t reload, CyBool_t upCount, uint8_t increment )

                   uint32_t initValue  = 0x0000000A

                   uint32_t limit         = 0x000000FF

                   CyBool_t reload    = CyTrue

                   CyBool_t upCount = CyTrue

                  uint8_t increment   = 0x01        

Regards,

Anil Srinivas.

0 Likes