Here you have the UartGPSC configuration and the UartGPSP module, you
should/could implement something like this to your uart sensor. In this case
i only use the uart, one can't use flash or radio in this configuration.
Relevant lines are red colored
configuration UartGPSC {
provides interface StdControl;
provides interface UartStream;
provides interface UartByte;
}
implementation {
components new Msp430Uart0C() as UartC, MainC;
UartStream = UartC;
UartByte = UartC;
components UartGPSP;
StdControl = UartGPSP;
UartGPSP.Msp430UartConfigure <- UartC.Msp430UartConfigure;
UartGPSP.Resource -> UartC.Resource;
}
module UartGPSP {
provides interface StdControl;
provides interface Msp430UartConfigure;
uses interface Resource;
}
implementation {
msp430_uart_union_config_t msp430_uart_gps_config = { {ubr: UBR_1MHZ_4800,
umctl: UMCTL_1MHZ_4800, ssel: 0x02, pena: 0, pev: 0, spb: 0, clen: 1,
listen: 0, mm: 0, ckpl: 0, urxse: 0, urxeie: 1, urxwie: 0, utxe : 1, urxe :
1} };
command error_t StdControl.start(){
return call Resource.immediateRequest();
}
command error_t StdControl.stop(){
call Resource.release();
return SUCCESS;
}
event void Resource.granted(){}
async command msp430_uart_union_config_t* Msp430UartConfigure.getConfig()
{
return &msp430_uart_gps_config;
}
}
Now as an example the configuration and module that use the UartGPS, this
are GPSC and GPSP.
configuration GPSC{
provides interface GPS;
}
implementation{
components
MainC,
GPSP,
NMEAOutputMsgsC,
NMEAInputMsgsC,
SiRFInputMsgsC,
ProtocolManagerC,
new TimerMilliC() as Timer,
UartGPSC;
GPS = GPSP;
GPSP.Boot -> MainC.Boot;
GPSP.GGAMsg -> NMEAOutputMsgsC.GGAMsg;
GPSP.GLLMsg -> NMEAOutputMsgsC.GLLMsg;
GPSP.NMEAInputMsgs -> NMEAInputMsgsC.NMEAInputMsgs;
GPSP.SiRFInputMsgs -> SiRFInputMsgsC.SiRFInputMsgs;
GPSP.ProtocolManagement -> ProtocolManagerC;
GPSP.Timer -> Timer;
GPSP.UartGPS -> UartGPSC;
}
module GPSP{
provides interface GPS;
uses{
interface Boot;
interface NMEAMsg<GGAMsg_t> as GGAMsg;
interface NMEAMsg<GLLMsg_t> as GLLMsg;
interface NMEAInputMsgs;
interface SiRFInputMsgs;
interface ProtocolManagement;
interface Timer<TMilli>;
interface StdControl as UartGPS;
}
}
implementation{
UTCTime_t utc_pos;
Latitude_t lat;
Longitude_t lon;
uint8_t nmea_state;
event void Boot.booted(){
call UartGPS.start();
......
......
......
I hope this would be useful . I also have a software uart implementation for
tmote, this works fine at low baudrates 2400-4800 its full duplex, and
allows you to use flash and radio.
On Mon, Jul 7, 2008 at 7:21 AM, Stefano Kismet Lenzi <[EMAIL PROTECTED]>
wrote:
> On Sat, Jul 5, 2008 at 23:05, Guillermo De Cesco <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >
> > the hardware Uart you are tring to use is share as a SPI bus with the
> stm25p
> > flash and the cc2420 chip (tmote). If you expect to use the uart
> > receive as a response to a command you send first you could request the
> > resource block it until you receive the response and the release, this
> way
> > you would be able to use the flash and the radio, if the receive is
> > asynchonous, ie you don t know when you would receive bytes trough uart
> you
> > must own the resource for ever, in that case you wont be able to use
> flash
> > or radio.
> > Mail me if you need an example, i actually interface a gps through uart
>
>
> I'm really interested in the topic would you mind to share the code
> that you use on the list? Or even better write some line on the Wiki
> as documentation?
> In my lab we would like to attach external sensor by means of the UART
> to the Iris and MicaZ platform, and we thought it would be seamless as
> reading from the UART when you connected the mote to the PC, but it
> seems to be me much more difficult.
>
> >
> > luck
> >
> > Bill
> > _______________________________________________
> > Tinyos-help mailing list
> > [email protected]
> > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> >
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help