C2000 SPI Read/Write from specified EEPROM address

5 views (last 30 days)
I've taken a look at the Matlab example models, and I have been able to do a batch read/write, but I am unsure as to where on the EEPROM the data is being stored. When checking the register address checkbox, what do the numbers in the register access dialog correspond to? Is it command(2), address (0), and data length(32)? And is the data length in bytes, words, or data elements?
I would like to do several one-time writes and reads to various locations on the EEPROM, and do not know how to specify the location on the EEPROM. I would like to read/write from/to a specified (non-default) address using the master transfer block (or any other SPI block for that matter).
  1 Comment
Graham Cotgreave
Graham Cotgreave on 18 Aug 2022
Edited: Graham Cotgreave on 18 Aug 2022
Hi, I have a very similar problem getting information about that register.
I was pointed to What are the use case scenarios for SPI (Master Transfer/Transmit/Receive) blocks when developing a Simulink Application for ... - MATLAB Answers - MATLAB Central (mathworks.com) , that does explain the second and third digits as being a "Register address" so I don't believe it is a data length - that is determined by the input stream.
The help says "The positive integer vector is specified as, [2 0 32] for Write Data to Memory and [3 0 32] for Read Data from Memory. For more information, refer to the examples [Using SPI to Read and Write Data to SPI EEPROM]. - but there are no further details their as described.
I have also seen a different case "Register address: [2]", which I assume means the signal at the input would be interpreted as ADRR ADDR ADDR DATA DATA DATA DATA.... but can't confirm that.

Sign in to comment.

Answers (0)

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!