I bought a couple of pmodia boards very recently, and tried to communicate with it using chipkit u32. I carefully read the manual of ad5933 and pmodia as well (i2c communication stuff in particular). Then, I tried to use the demo code to start talking with it via chipkit u32. However, it did not respond. I checked the code, and figured that it stuck since the status register never gives out a "ready" bit to read temperature, etc. Not matter how I command it to initialize sweep or perform temperature measurement. The output from the status register (0x8F) is always 0111 0000.
Then, I switched to an arduino uno. It seems the address pointer can be assigned to different address, and I can write to the desired address, and read them back correctly, e.g., I can send 0x90 to the control register (0x80) for temperature measurement. Then, move the pointer to command register (0x80) to read out "0x90" correctly. Unfortunately, the status register (0x8F) always reads as 0111 0000. I tired many combinations with varying delay time between writing command to 0x80 and reading status register. Unfortunately, the result is the same. It seems to me that the PmodIA is not performing temperature measurement, or frequency sweep at all after my commands.
I had great experiences working with diligent boards (Zedboard and zybo), and typically figured out problems by myself. However, this bug frustrated me for almost 5 days. Please advise!
Following is the simple code I used to test the communication, and its response from serial monitor. I hope this can help debug. In addition, 12k pull-up resistor is provided for both SDA and SCL as suggested by the AD5933 user manual.
PmodIA Demo Press 'r' when ready!! IN test 128 ********** 96 128 45 ********** 128 ********** 9 55 75 ********** 1110000 (the status register 0x8F always gives this value, meaning "not ready")
Question
mecwee
Hi there,
I bought a couple of pmodia boards very recently, and tried to communicate with it using chipkit u32. I carefully read the manual of ad5933 and pmodia as well (i2c communication stuff in particular). Then, I tried to use the demo code to start talking with it via chipkit u32. However, it did not respond. I checked the code, and figured that it stuck since the status register never gives out a "ready" bit to read temperature, etc. Not matter how I command it to initialize sweep or perform temperature measurement. The output from the status register (0x8F) is always 0111 0000.
Then, I switched to an arduino uno. It seems the address pointer can be assigned to different address, and I can write to the desired address, and read them back correctly, e.g., I can send 0x90 to the control register (0x80) for temperature measurement. Then, move the pointer to command register (0x80) to read out "0x90" correctly. Unfortunately, the status register (0x8F) always reads as 0111 0000. I tired many combinations with varying delay time between writing command to 0x80 and reading status register. Unfortunately, the result is the same. It seems to me that the PmodIA is not performing temperature measurement, or frequency sweep at all after my commands.
I had great experiences working with diligent boards (Zedboard and zybo), and typically figured out problems by myself. However, this bug frustrated me for almost 5 days. Please advise!
Following is the simple code I used to test the communication, and its response from serial monitor. I hope this can help debug. In addition, 12k pull-up resistor is provided for both SDA and SCL as suggested by the AD5933 user manual.
pde file in Mpide 0150
#include <WireIA.h>
#include <inttypes.h>
#include <Wire.h>
#include <EEPROM.h>
IA testIA;
void setup()
{
Serial.begin(9600);
Serial.println("PmodIA Demo");
Serial.println("Press 'r' when ready!!");
while(Serial.read() != 'r');
testIA.IA_init();
testIA.IA_test();
delay(20);
testIA.setControlRegister(1,1);
testIA.setControlRegister(9,1);
delay(1000);
uint8_t disp;
disp = testIA.readRegisterValue(0x8F);
Serial.println(disp,BIN);
}
void loop()
{
}
Respond from serial monitor
PmodIA Demo
Press 'r' when ready!!
IN test
128
**********
96
128
45
**********
128
**********
9
55
75
**********
1110000 (the status register 0x8F always gives this value, meaning "not ready")
Link to comment
Share on other sites
16 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.