Hi,
I am trying to send data over serial port. Since I dont want extra header, I
am using HPLUARTC and UARTComm. Sent byte should be reflected (please see
the code below) back but it seems to be different than the sent data.
For instance..
128 is received for 0
128 or 192 is received for 128
129 or 193 is received for 129
255 is received for 255
191 or 255 is received for 191

It is like only 7 bits are used for data instead of 7 ( and leftmost bit
always 1). I also checked HPLUARTOM to see frame format but it seems ok. (8
data bits, 1 stop bit)

What might be the problem?

Thanks,



configuration TestUartSimple {
}
implementation {
  components Main, HPLUARTC, TestUartSimpleM, TimerC, LedsC, UARTComm as
Comm;

  Main.StdControl -> TimerC.StdControl;
  Main.StdControl -> TestUartSimpleM;

  TestUartSimpleM.CommControl -> Comm;
  TestUartSimpleM.HPLUART -> HPLUARTC;
  TestUartSimpleM.Timer -> TimerC.Timer[unique("Timer")];
  TestUartSimpleM.Leds -> LedsC;
}

///////////////////////////

module TestUartSimpleM {
  provides {
    interface StdControl;
  }
  uses {
    interface Leds;
    interface Timer;
    interface HPLUART;
    interface StdControl as CommControl;
  }
}
implementation {

  command result_t StdControl.init() {

    call Leds.init();
    call Leds.yellowOff(); call Leds.redOff(); call Leds.greenOff();

    call CommControl.init();
    call HPLUART.init();

    return SUCCESS;
  }

  command result_t StdControl.start() {
    call Timer.start(TIMER_REPEAT, 1000);
    call CommControl.start();

    return SUCCESS;
  }

  command result_t StdControl.stop() {
    call Timer.stop();
    call CommControl.stop();

    call HPLUART.stop();
    return SUCCESS;
  }

  event result_t Timer.fired() {
    call Leds.redToggle();
    return SUCCESS;
  }

  event async result_t HPLUART.get(uint8_t data) {
    call HPLUART.put(data);
    call Leds.greenToggle();
    return SUCCESS;
  }

  event async result_t HPLUART.putDone() {
    call Leds.yellowToggle();
    return SUCCESS;
  }

}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to