I’m proud to annunce the first, still totally untested, version of the DispatcherC component, currently hosted on the mercurial repository (http://freehg.org/u/dacav/tiny_cynar_dispatcher/ ).
The component provides:
- A protocol for nxt commands encoding
- A modularized code that allows the programmer to access both the cc2420 radio and the uart
Commands encoding
I’ve developed a lightweight remote command library for the NxOS operating system in replacement of the rcmd library. Our structure is tailored for uart transfers at about 9600 baud, so we need for quick transmissions!
The following features are available through the NxOS rcmdlw library:
- Shutdown of the Nxt brick
- Motors rotation (with non exclusive selection of the motor) parametrized with time or angle
- Motor breaking (with non exclusive selection of the motor)
- Straight robot movement (until new order …or death for battery discharging
) - Robot rotation
;
The library uses a specific binary protocol that may be extended with other functions, like getters for the radar.
The same protocol has been implemented on some internal components of the Dispatcher component. They allow the encoding of all the previously listed commands into a buffer that gets transmitted through the uart interface. This basically will provide a easy way for controlling the Nxt brick.
Radio vs Uart
Although quite unexpected, we found some conflicts in the simultaneous communication between tmotes (through the cc2420 radio) and between the tmote and the associated nxt brick.
The DispatcherC component builds a wrapper for some the interfaces provided by ActiveMessageC, and manages the exclusive channel activation in a transparent way, by switching the radio off before uart transmission requests, and by reactivating it after the transmission (or, if needed, the reception of the acknowledgment).
Since the only way to access the Uart link is switching off the radio, some radio packet may be lost. In order to avoid this, the programmer may activate the PacketLink layer extension provided by the CC2420 Radio Stack.
Source code
The DispatcherC component is available here. This is a simple mercurial repository.
For the NxOS side, all the source code is part of the nxos_half_duplex patch repository. This is a patch repository, it tracks patches for the current (changeset db3ab874e604) version of NxOS. Actually most of the patches achieves modifications and bugfixes for the operating system… I should tidy up my stuff ![]()
Filed under: Organization, Results | Tagged: lightweight remote command library, msp430 cc2420 uart