Accessing Registries via I2C Communication

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

cross mob
Anonymous
Not applicable

Hello everyone, this is my first post and my first real endeavor into such a project.  First of all, I would like to commend Cypress for the state-of-the-art technology.

   

I just started using PSoC a few days ago and am using the CYONS2000xLBxC for laser navigation purposes. 

   

I am using the PSoC Designer 5.1.

   

I believe I have initialized communication between the CYONS2000-LBxC and the MCU via I2C. I have simply used the source code "Example_I2CHW" from Cypress's Source Code section and am having a tough time writing the C code to access the respective registry in which I would like to extract data from. 

The data I wish to extract is that of the X and Y displacements sensed, which is recognized by the number of counts acknowledged (i.e. 800 Counts = 1 inch). This data needs to be transmitted using the I2C and into the MCU interface so that the positional values are attained. 

At this stage, I am using the Example_I2CHW project as a base and am trying to write valid code so that this objective is met. Am I on the right track? Is there any helpful references you could supply me with? Am I even making sense?

Thanks a million in advance,
Andrew

0 Likes
2 Replies
MR_41
Employee
Employee
First like received

I have written to the ONS navigation product experts to provide you with information on your questions.

   

 

   

Best Regards,

   

Ganesh 

0 Likes
Anonymous
Not applicable

 Hi Andrew,

   

Judging from your interaction with John on the CRM system, you may have already answered several of your own questions, but just in case, I thought that I would give you some hints:

   

Your project should use at least two user modules: I2CHW for communication and LaserNAV to implement the tracking engine. There is a large amount of reference material about how to use these user modules available right at your fingertips in PSoC Designer in the form of user module datasheets. To access them, simply right-click on the user module that you want to learn how to use in either the Workspace Explorer or User Module Catalog window, and select one of the view options in the 'Datasheet' drop-down menu.

   

Contained in these  datasheets, there is a description of the APIs that the user module makes available to you, and some example code which shows how it is used. I recommend using the example code in the LaserNAV and I2CHW user module datasheets as a starting point, and reading through the list of API descriptions to learn how to combine, use, and modify that example code to build a project which meets your requirements.

   

For example, the LaserNAV_fReadXYCounts(&XYData) function will update the XYData array with the current movement information from the sensor. 

   

Anyway, again, it seems like you may have figured a lot of this out on your own. If you have any additional concerns, John and I can answer them most effectively through the CRM system.

   

Regards,

   

-James

0 Likes