Skip to content

Vladican/gsMote

Repository files navigation

To use sd card in FAT format, first call the SD_init() function, then the getBootSectorData() function. After that, the writeFile() and readFile() functions can be used
to access the data on the sd card. Alternatively, the card can be used without a filesystem structure by first initializing it with SD_init() and then writing and reading
to/from the 512 byte sectors on the card using the SD_read_block, SD_write_block, SD_read_multiple_blocks and SD_write_multiple_blocks functions. However, if sector 0 is 
overwritten, the card needs to be reformatted to use it in FAT format.

When reading data from a file, since a single cluster used by files in the FAT32 file system is bigger than the FRAMBuffer, the data needs to be either transmitted or processed
some other way as it is being read inside the readFile function to avoid data loss.

Make sure to turn off power to the sd card with SD_disable when the card is not in use in order to avoid wasting energy (if the card is disabled it needs to be reinitialized 
with SD_init() ). 

To use the radio, first initialize the radio stack with chb_init(). Then you can set varius radio parameters like transmit power, radio address, radio channel, etc. with the 
corresponding configuration methods available in chb_drvr.h . The radio initializes into listen mode and transits back into listen mode after sending a transmission. When a message is received, 
a flag is set in the chibe "pcb_t" object (chb_get_pcb() returns the pointer to that object). 

Max payload of data is 100 bytes per radio transmission. If more than that is provided as argument to chb_write then it will get broken up into several transmission.

The default transmission power level seems to be pretty low so that it needs to be increased for field testing.

known bugs/limitations:

- the radio cannot process a heavy stream of consecutive messages and will hang if a message is received while it is doing some internal processes in the receive state.
		- possible fix for this would be to clear the interrupt register in the radio when a message has not been received in 'x' seconds while the radio 
		  was in the receive state. This will at least avoid the radio hanging indefinetly. 

   

About

gsMote firmware

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published