Quantcast

Uart Receive from an External Sensor

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Uart Receive from an External Sensor

Atakan Bodur
Hello,

I'm working on taking sensor readings from Uart but have some trouble on receiving raw bytes thru Uart. I'm trying to take an array of bytes using UartStream interface with Msp430Uart1C as provider. I call UartStream.receive command to receive bytes and know that this call returns SUCCESS. However, after bytes are sent to Uart (i'm sending bytes myself using HyperTerminal for the time being, so i'm sure about that), UartStream.receiveDone event is not signalled.

I also tried using Resource interface (according to TEP109) with same provider as mentioned above and changed code such that a request is done by calling Resource.request command (which returns SUCCESS) and UartStream.receive command is called in my implementation of Resource.granted event. But this event is not signalled, either.

Finally I tried to revert transmit direction (calling UartStream.send command) for debugging in case there might be a problem in serial interface and succeeded in sending data and UartStream.sendDone event was signalled.

Does this mean that there is no problem in serial interface (having 1200 baud rate) or Uart configuration? If it does, what may be the problem? By the way, here is the Uart configuration I used.

msp430_uart_union_config_t config = {
 {ubr: UBR_32KHZ_1200,
  umctl: UMCTL_32KHZ_1200,
  ssel: 0x01,
  pena: 0,
  pev: 0,
  spb: 0,
  clen: 1,
  listen: 0,
  mm: 0,
  ckpl: 0,
  urxse: 0,
  urxeie: 1,
  urxwie: 0,
  utxe : 1,
  urxe : 1}
};

async command msp430_uart_union_config_t* Msp430UartConfigure.getConfig() {
    return &config;
}

Is there anyone who developed sensor drivers which send readings thru Uart like this? Any help would be great.

Thanks in advance,
Atakan
_______________________________________________
Tinyos-help mailing list
[hidden email]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Uart Receive from an External Sensor

Atakan Bodur
Hi again,

I looked at Msp430Uart1C and lower level components and figured out that ungranted resource seems to be the reason why UartStream.receiveDone event is not signalled.

Could any expert give me a reason why Resource.granted event may be unsignalled though Resource.request is called, or a suggestion about what should I do to make it be signalled?

Thanks in advance,
Atakan


On Thu, Jul 3, 2008 at 11:44 AM, Atakan Bodur <[hidden email]> wrote:
Hello,

I'm working on taking sensor readings from Uart but have some trouble on receiving raw bytes thru Uart. I'm trying to take an array of bytes using UartStream interface with Msp430Uart1C as provider. I call UartStream.receive command to receive bytes and know that this call returns SUCCESS. However, after bytes are sent to Uart (i'm sending bytes myself using HyperTerminal for the time being, so i'm sure about that), UartStream.receiveDone event is not signalled.

I also tried using Resource interface (according to TEP109) with same provider as mentioned above and changed code such that a request is done by calling Resource.request command (which returns SUCCESS) and UartStream.receive command is called in my implementation of Resource.granted event. But this event is not signalled, either.

Finally I tried to revert transmit direction (calling UartStream.send command) for debugging in case there might be a problem in serial interface and succeeded in sending data and UartStream.sendDone event was signalled.

Does this mean that there is no problem in serial interface (having 1200 baud rate) or Uart configuration? If it does, what may be the problem? By the way, here is the Uart configuration I used.

msp430_uart_union_config_t config = {
 {ubr: UBR_32KHZ_1200,
  umctl: UMCTL_32KHZ_1200,
  ssel: 0x01,
  pena: 0,
  pev: 0,
  spb: 0,
  clen: 1,
  listen: 0,
  mm: 0,
  ckpl: 0,
  urxse: 0,
  urxeie: 1,
  urxwie: 0,
  utxe : 1,
  urxe : 1}
};

async command msp430_uart_union_config_t* Msp430UartConfigure.getConfig() {
    return &config;
}

Is there anyone who developed sensor drivers which send readings thru Uart like this? Any help would be great.

Thanks in advance,
Atakan


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