This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I am trying to interface HMC6343 magnetometer from Honeywell with MSP430F5438A. I am facing some problems. Has anyone done this before.?
AAYUSH GUPTA said:I am trying to interface...
See: http://www.8052.com/forum/read/160143
I am facing some problems
What problems, exactly, are you facing?
What debugging have you done in an attempt to resolve them?
What was the outcome?
Here are some debugging hints & tips:
http://www.8052.com/faqs/120313
http://www.techonlineindia.com/article/09-09-23/Developing_a_good_bedside_manner.aspx
AAYUSH GUPTA said:Has anyone done this before.?
The forum 'Search' facility will answer that question for you:
eg, http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/95756.aspx
i have gone through this link. But this didnt help me.Andy Neil said:The forum 'Search' facility will answer that question for you:
eg, http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/95756.aspx
Following is my code. I am not getting any acknowledgement nor any NACK.
#include "msp430.h"
unsigned char Write = 0x32;
unsigned char Read = 0x33;
unsigned char Magre = 0x45;
int txready = 1;
void main()
{
WDTCTL = WDTHOLD + WDTPW;
P1DIR = 0X03;
P1OUT = 0X00;
P10SEL = 0XFF;
UCB3CTL1 |= UCSWRST;
UCB3CTL0 |= UCMST + UCMODE_3 + UCSYNC;
UCB3CTL1 |= UCSSEL_2;
UCB3BR0 = 12;
UCB3BR1 = 0;
UCB3I2CSA = Read;
UCB3CTL1 &= ~UCSWRST;
UCB3IE = UCTXIE;
_EINT();
UCB3CTL1 |= UCTXSTT + UCTR;
while(1)
{
while (UCB3CTL1 & UCTXSTP);
UCB3CTL1 |= UCTXSTT + UCTR;
txready = 1;
_BIS_SR(LPM0_bits);
}
}
#pragma vector = USCI_B3_VECTOR
__interrupt void abc()
{
switch(__even_in_range(UCB3IV,12))
{
case 12:
if(txready)
{
UCB3TXBUF = Magre;
txready--;
P1OUT ^=0X01;
}
else
{
UCB3CTL1 |= UCTXSTP;
UCB3IFG &= ~UCTXIFG;
_BIC_SR_IRQ(LPM0_bits);
}
break;
default:
break;
}
}
AAYUSH GUPTA said:I am not getting any acknowledgement nor any NACK
So, again, what debugging have you done in an attempt to find out why?
I am using IAR Workbench. I checked registers after every statement execution.
AAYUSH GUPTA said:I am using IAR Workbench.
IAR Workbench is a software tool; but this is not just a software exercise - what hardware tests/measurements have you done?
I checked registers after every statement execution.
Checked them against what?
I have done nothing for that.. I have the evaluation board of HMC6343. I just connect the required pins with MSP430 and burn the code with MSP as master of I2C bus.Andy Neil said:hardware tests/measurements
Checked them against the bits. If the ACK or NACK bit is changing or not.Andy Neil said:Checked them against what?
AAYUSH GUPTA said:I have done nothing for that..
Then, clearly, you need to!
Obviously, you will not get any ACK or NACK if the signals are somehow failing or incorrect at the hardware level!
You also need to check all the register settings against the datasheet.
You should also check your code against the examples provided by TI, and any 3rd-party examples that you can find.
**Attention** This is a public forum