Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BrendanKelly84213
Copy link
Contributor

Description (tell us what you changes or added or removed please)

This is the driver for SPI communication with MRAM chip from MSP4305969. We have bigger priorities so these are just for future reference.

How to test (if any tests done)

Get an MRAM and MSP4305969 launchpad and wire correctly. If you want to test a sandbox project its in Tools/MSP_SPI_MRAM_DEMO

Checklist

  • [ x] Code Compiles
  • [ x] Did you add any comments
  • [x ] Did you test it at all ?! Good Boy/Girl

WIP. Wanted to capture without breathing too hard on anything
since last time we got something from the MRAM it only worked once
Seems to work every time! No Idea!
Easier to see on the logic analyzer
The first byte will always (?) be 0x00, so we just skip it
This allows us to use the same ISR to receive different lengths of
bytes from the MRAM.
…r, writing to MRAM, reading, and reading device ID all works
I've had bad luck with uint32_t on the MSP in the past.
I don't think it's officially supported
Incrementing down returns the ID backwards for me, so increment up.
This way it shows up in the debugger
Just make naming a little more consistent and add some
comments
Tried to replicate how the code looks in driverlib.h as much as possible
MRAM_camelCase for MRAM function decleratiosn
SPI_camelCase for SPI declerations
delaying cycles after didn't do anything because we had already
exited the ISR
This makes it easier to use understand but mostly for comparing
address values in error handling
This checks to make sure write memory protection doesn't
get in the way of trying to write within a block of memory
by reading the status register provided MRAM
Our MRAM supports bulk transfers (command + address + arbitrary bytes)
for both read and write.
Implements MSP430 builtin hardware CRC as checksum
Reads back data we just wrote and validates the CRC
Just check the CRC immediately after writing.
We can worry about packet structure later if at all.
Gotta redo this later it DOES NOT COMPILE!!
For now just stick this in the I2C.c file  because it works
and I'm getting hungry and tired and need to commit these changes
NOTE: really need to squash this before PR, not now though
Since we are abandoning this for this project
@BrendanKelly84213 BrendanKelly84213 self-assigned this Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants