Jump to content
43oh

SPI and AS5048A and LM4F120


Recommended Posts

Hi, if this is the wrong forum please direct me elsewhere.

 

I have an AS5048A chip that I've successfully pulled data from using an Arduino board.

Datasheet for AS5048A - http://www.ams.com/eng/content/download/438523/1341157/file/AS5048_Datasheet.pdf

 

I finally pulled my LM4F120 eval kit that I got last year out and started playing with it. I'm not having any success reading data from the chip with it, though. My embedded experience is limited to the higher level abstractions of Arduino stuff and I occasionally feel like I'm just flapping my arms uselessly. I will say that being able to step through my code running on the LM4F120 (is that the proper way to describe it?) is totally pleasurable and super handy.

 

At any rate, my issues:

First, here's the code that should successfully grab the data with an Arduino board. At least, an equivalent was until mine stopped allowing me to upload to it.

http://pastebin.com/aXGvkXiw

 

The chip says I can interface in 4-wire or 3-wire mode. 3-wire being read only. (Page 13 of the datasheet)

 

I've tried enabling GPIO port A, enabling SSI, configuring the 3 pins for RX, CLK, and SS. When in this mode whenever I call GPIOPinTypeSSI PA3 (SS) goes high and I can't write it low with GPIOPinWrite(). I realize that's probably the wrong way to do it, but I don't know enough yet to know better.

 

I've also tried enabling GPIO port A, enabling SSI, configuring RX and CLK for SSI, and configuring PA3 for GPIOPinTypeGPIOOutput thinking I need to set it to low then high manually (as the datasheet and the Arduino code show). I should point out that this feels entirely wrong.

Relevant code: http://pastebin.com/9GhjLwk8

 

I've also tried compiling and running the equivalent Arduino code in Energia. All to no avail.

 

I'd appreciate any pointers, pointing out of errors, or even a working example for interfacing with this chip. I wasn't expecting to run into this so early into my project. :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...