Archive for the ‘ Doorlocks ’ Category

Atmega 8 serial and iButton code

Last weekend was project work weekend, and I started messing with my atmega8 and olimex development board to get some serial communication working. After implementing the really simple USRT code they demoed, I wrote some simple print functions so I could get useful debug output.

 

Tuesday night I decided to port the onewire library written for the arduino to C for the atmega8. After a few hours, I got the sensor detecting my iButton.

Code is available here.

Next step is to implement the spi bus for the ethernet module.

Advertisements

Wiznet module

I’ve done nothing productive all summer.

A few days ago, I ordered an SPI ethernet module from a local company for 20 bucks. I just started playing with it today. It’s the same one used in the arduino ethershield, so it was pretty easy to hook up. I’d never worked with anything on an SPI bus before, but it’s pretty damn simple. All I needed was power, ground, and four data lines and I was set. The only thing else I had to do was tie the reset high so the board would run.

The chip is really full featured. While all the features of the board can be used with the SPI bus, there are also some parallel data ports broken out for higher transfer speeds. When I get my ARM I’m going to dig into the data sheet a bit more if I can to see what kind of performance I can pull out of it.

In the meantime using it with arduino’s libraries made it really easy to get a simple server up and running, which is pretty immediately gratifying. Considering I worked on it for something like two hours, I haven’t had a chance to write anything interesting with it, but it’ll probably be involved with the doorlocks somehow. We’ll see.