AD5933 impedance measurement with PSoC

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hey community, I hope creating a new topic will arouse more attention for my problem. Does anybody have any experience to measure the impedance using the AD5933 and a PSoC? I managed to measure the temperature with the AD5933 and read out the results. But I am in despair, not able to use the takeaway from the temp measurement for the impedance measurement. Maybe someone has some advice or code with a similar device from the company "analog devices". Thank you in advance, Alex

0 Likes
8 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

What is your actual question? When you are able to read the temperature, it seems communication with the AD5933 works fine.

   

The data sheet for the AD5933 explains in detail how to use the freuency generator to excite the impedance, and how to calculate the impedance from the measurements.

0 Likes
Anonymous
Not applicable

Hi hli,

   

this exactly is my problem, my temperature measurement is working, so I thought by just adjusting my code for the different addresses, the impedance measurement should also be fine. But somehow I am missing something.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your view on how I2C works is not quite correct.

   

You should use a Restart() only when you switch from writing to slave to reading from slave (or the other way round)

   

Do not use Restart() after a stop condition

   

A complete I2C transaction runs from SendStart() to SendStop(), it is no good idea to have delays within, since that keeps the bus busy.

   

A delay within one I2C transaction is usually handled by the slave by extending the clock to the required time.

   

What are the lines

   

    status=status<<5;
    status=status>>5;

   


good for?

   

Every I2C-command except ReadByte() returns a status information which is zero (0) at normal completion. As long as your device does not run smoothly I would suggest to check every  returned value and stop at the first non-zero to analyze/correct the reason.

   

Write a function: void I2C_Analyze(uint8 Status) , set a breakpoint when Status is non-zero and use in your program something like

   

I2C_Analyze(I2C_MasterSendStart(0x0D, I2C_WRITE_XFER_MODE));
I2C_Analyze(I2C_MasterWriteByte(0x8F));

   

and so on. This will reveal any errors instantly.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks for the advice Bob! Since I need to write different values to different register addresses, instead of using Restart(), would you suggest to just use one SendStart() and then write all my values one after another to their adresses, or should I use SendStart() and SendStop() for each value?

   

The lines status=status<<5;
                status=status>>5

   

is just some bit-shifting to change the output form of my value.

   

I will check my code with the analyze function and will then text here again what I found out.

   

Best regards, Alex

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Writing blocks of data generally is faster than a Sendstart(), WriteByte()..., SendStop() sequence. So it is up to you what is easier for you to use. Have a deep look into your AD5933 Datasheet, page 28. There reading, writing and blockread/write is explained in detail.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

So finally it is working! I simply used SendStart() ......... SendStop() around every register I wanted to adress.

   

Thanks for the help guys

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

You are always welcome!

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
shuvra1
Level 5
Level 5
100 sign-ins 10 likes given 100 replies posted

Can you Replicate this project & send me the actual HEX file for PSoc 5LP Prototyping Kit??  Send it to -p20210447@hyderabad.bits-pilani.ac.in

0 Likes