Giovanni,
For just informational high/low output, you only need a simple digital
output -- you do NOT need more complicated analog output, which is
useful for generating things like audio waveforms. Just do something
like this in your module
module MemeP {
uses interface MSP430GeneralIO as InfoGio;
}
implementation {
// To initialize your "Info Pin":
void initInfoGio() {
call InfoGio.setHigh();
call InfoGio.selectIOFunc();
call InfoGio.makeOutput();
}
// To actuate your "Info Pin", use either of these commands:
// call InfoGio.setHigh();
// call InfoGio.setLow();
}
... and this in your configuration ...
configuration MemeC {
}
implementation {
components MemeP;
components MSP430GeneralIOC;
MemeP.InfoGio -> MSP430GeneralIOC.Port60; //pick some port you can access
}
Best,
Cory
On 6/8/06, giovanni gamba <[EMAIL PROTECTED]> wrote:
Hi, i'm working with Tmote Sky and i need to use the DAC pin to
do a set of measures. I want to enable the analog output
and set it to zero volt. When i receive a message i lift the voltage value
for, e.g, 10 ms and then set it to zero again (this way i can measure
distances
between rising or falling edges due to different messages with
a real oscilloscope ).
I tried to use the MSP430DAC12C component, but my app hangs inesorably...
Below i post the steps i do in the program...
Please help me.. Thank you!!
/************************************/
interface MSP430DAC as Measure_PIN;
interface Timer as Measure_TIMER;//32 khz
command result_t StdControl.init() {
//...
call Measure_PIN.bind(DAC12_REF_VREF, //internal voltage
reference
DAC12_RES_8BIT, //resolution 8 bit
DAC12_LOAD_WRITE, //write directly
DAC12_FSOUT_1X, //1X voltage
DAC12_AMP_MED_MED, //medium response time & power
DAC12_DF_STRAIGHT,//unsigned int
DAC12_GROUP_OFF);//group off, using only one DAC
// second mandatory step for measure init
call Measure_PIN.enable();
//...
}
/************************* Measure_PIN
***********************************/
event void Measure_PIN.enableDone(result_t success){
call Measure_PIN.enableOutput();
call Measure_PIN.set(0);//a sort of initialization
return;
}
event void Measure_PIN.disableDone(result_t success){
return;
}
/************************* Measure_TIMER
***********************************/
event result_t Measure_TIMER.fired() {
call Measure_PIN.set(0);// HI2LO reset the voltage value
return SUCCESS;
}
/************************* RECEIVE_ALARMS from RADIO
************************************/
event TOS_MsgPtr ReceiveAlarms.receive(TOS_MsgPtr m) {
alarm_tmp=m;
if (state==ON){
if (((AlarmMsg*)m->data)->src==slave_target){
call Measure_PIN.set(0x70);//LO2HI lift the measure
signalto half the max value 0xff
call
Measure_TIMER.start(TIMER_ONE_SHOT,2<<5);
}
post enqueueAlarm();
}
return m;
}
/****************************************************/
Thank you very very much!!!!
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help