Sign in

username:

password:



Not a member?

Search msp430



Search tips

Subscribe to msp430





Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | MSP430 | Help!Try to input an external voltage to ez430-rf2500 target board.

The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.

Help!Try to input an external voltage to ez430-rf2500 target board. - bett...@hotmail.com - Sep 22 9:50:38 2009

Im quite new to this tool. My proj is to connect EKG board to eZ430-RF2500 target board. 1st of all, I tried to input a direct voltage to eZ430-RF2500 target board to fake as EKG signal.

I chose P2.0 (Pin 3 on the board) as input pin. Basically i juz follow the sample code "Temperature mearsure" and "Voltage measure" parts to add in code. Here is my code(simplified):

//Declaration (Only show the msg[] and result[] )
uint8_t msg[8];
int results[3];
int aNewVolt;

//Ports
P2DIR = 0x2E;

//This part is for temperature measurment (Omitted)

// I/p the voltage. I/p pin is P2.0 (pin 3, A0)
ADC10CTL1 = INCH_0; // A0
ADC10CTL0 = SREF_1 + ADC10SHT_3 + REFON + ADC10ON + ADC10IE + ADC10SR;
__delay_cycles(350); // delay to allow reference to settle
ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start
__bis_SR_register(LPM0_bits + GIE); // LPM0 with interrupts enabled
results[2] = ADC10MEM;
ADC10CTL0 &= ~ENC;

//This part is for voltage measurment (Omitted)

//Passing value
aNewVolt=results[2];
msg[8]=aNewVolt;

I plug in the target board (without apply external voltage) and open the hyper terminal, the value of aNewVolt is 33 or 32.
Then i searched other forum. I saw some ppl also did similar thing as i did. I copied their code and aNewVolt value is still 32 or 33 when no input voltage is applied:

ADC10AE0 |= 0x01 ; // analog input enable for A0
ADC10CTL1 = INCH_0; // A0
ADC10CTL0 = ADC10SHT_2 + ADC10ON + ADC10IE + ADC10SR;
__delay_cycles(350); // delay to allow reference to settle
ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start
__bis_SR_register(CPUOFF + GIE); // LPM0 with interrupts enabled
result[2] = ADC10MEM;
ADC10CTL0 &= ~ENC;

This code is from
http://forum.sparkfun.com/viewtopic.php?t=14528&highlight=ez430rf2500
I changed it slightly.

It is supposed to be 0 if i dont apply voltage, rite? Anybody plzzzz help me wiv the code?????
Plus, the ground from power generator must connect to ground pin rite? Tks!!!

------------------------------------



(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )