I'm trying to connect a CMUCam2 with a MicaZ via Uart. Since the camera can't understand TOSMsg packets i need to change commands byte-to-byte.
A attached a TTL Serial port into MicaZ expansion Uart pins (27 and 28). The comunication uses Micaz default settings 57.6 Kb, 8 bits no parity, 1 bit stop word.
In MicaZ programming side I'm using the HPLUART interface... the send da function works pretty fine but teh get one (to receive data from the camera don't work). When a comunicate via RS-232 (MIB-510) using minicom teh comunication works perfectly.
Can anyone point me some direction???? A have tried a lot of things and nothing worked. He is a sample of my code:
module TestUartCamM {
provides {
interface StdControl;
}
uses {
interface Leds;
interface Timer;
interface HPLUART;
}
}
implementation {
// uint8_t cnt;
uint16_t cnt;
char * msg = "l0 1\r";
task void sendChar() {
atomic {
if(cnt < strlen(msg)) {
call HPLUART.put(msg[cnt]);
}
}
}
command result_t StdControl.init() {
// para começar do incio do texto
atomic {
cnt = 0;
turn = 0;
}
call HPLUART.init();
return SUCCESS;
}
command result_t StdControl.start() {
call Timer.start(TIMER_ONE_SHOT, 5000);
return SUCCESS;
}
command result_t StdControl.stop() {
call Timer.stop();
return SUCCESS;
}
event result_t Timer.fired() {
post sendChar();
call Leds.redToggle();
atomic {
turn++;
}
return SUCCESS;
}
event async result_t HPLUART.get(uint8_t data) {
call Leds.greenOn();
if(data == 'A' || data == 'a') {
call Leds.greenOn();
}
else {
call Leds.greenOn();
}
return SUCCESS;
}
event async result_t HPLUART.putDone() {
atomic {
cnt++;
}
post sendChar();
call Leds.yellowToggle();
return SUCCESS;
}
}
--
Carlos Eduardo Rodrigues Lopes
Mestrando em Engenharia Eletrica - UFMG
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
