Saturday, August 20, 2011

The WiFi Trek Begins

I started looking into implementing WiFi in the platform with the Microchip resources and thought that it might be useful to chronicle what I did. This serves the dual purpose of showing others how I go about figuring something out that I've never done before and the resulting blog post can serve as somewhat of a reference note that I can refer back to. So the goal is to send some data over WiFi with the platform. I've never done that before so here's how I'm going about it.

Hardware or Firmware First

I need to create a breakout board for the wifi module but before I do that I want to see how difficult it will be to integrate the Microchip stack into my firmware. If it turns out to be a huge pain then maybe I'll reconsider modules.

Get the Stack

Can't get the stack by itself. You have to download the entire 184MB of the Microchip Application Library and then, on install, you can decide only to install the tcp stack which appears to be a simple file extraction from the massive exe. Oh well, Microchip's business is creating chips not customer friendly software. While that was downloading I decided to give the MRF24WB0MA datasheet a read. More on that in a minute. Once I was done with that the download was finished so I started the download of the library documentation which is another 45MB. Why isn't that in the massive application library exe I just downloaded? Nevermind. While that was downloading I installed Eagle on my Ubuntu machine because I'll need that when I want to create a breakout board.

Datasheet Notes

A few things of interest in the datasheet. Page 11 has the footprint I'll need to create a breakout board in Eagle. Page 13 has an example application schematic that I'll mimic pretty closely in connecting it to the 27J53. Hibernate state can significantly extend battery life but isn't useful for intervals less than 30 seconds. The slave SPI interface implements the [CPOL=0;CPHA=0] and [CPOL=1; CPHA=1] modes (0 and 3) of operation. That is, data is clocked in on the first rising edge of the clock after Chip Select (CS) is asserted. This will be important when setting up the SPI driver in the wifi module. The SPI clock frequency can be up to 25MHz which is fine since currently the platform is running at 16MHz.

WiFi Is Up Next

So the PICBoot project takes care of the bootloader portion of the project and includes an SD card module which we can plug in to our main app if we need it. Next up is adding WiFi functionality.

Microchip MRF24WB0MA

I'm going to try to implement the WiFi portion of the project with the MRF24WB0MA from Microchip. They have a free networking stack that hopefully will plug in nicely to the module pattern I'm trying to follow. The price is pretty good compared to other offerings out there and the performance is comparable according to the datasheet. I'm just getting in to the implementation and hope to have a few posts on it. Specifically I need to get the code plugged in and I'll also need to create a custom PCB for the module to make it breadboard compatible. I really need to get around to fixing the speed issue in PICBoot. Reading 1 byte at a time in the hex file is really causing it to dog in performance. I think if I read like 512 or even 256 bytes at a time the performance would be significantly better.

Friday, August 19, 2011

PICBoot Alpha

Format Change

So, I've decided not to continue from the last posts like I said. I spend a lot of time trying to prepare educational posts to get something ready for the public eye that I could be spending on writing code and just laying it out as it is and getting feedback. In other words, I want to spend less time polishing my posts and more time writing code and putting out quick updates.

PICBoot Bootloader

As the last few posts suggest I started working on a bootloader. Well, the preliminary version of that bootloader is now available on github. It currently runs on the PIC18F27J53 but there is no reason that it couldn't be modified to work on other 18F chips. Once programmed onto the chip it will read a hex file from the SD card at startup and program the device. It's in it's early stages but it does work. I'll continue to enhance it as I have time but really the point was to get something up so I could start working on the platform and have a field programmable way of updating the firmware.