0

A week of seven Sundays

Posted by Chris on Thursday, April 02, 2009
It's been a bit like Groundhog Day in Nerd Towers this week, each morning getting up, checking the post, no PIC programmer, sinking into a malaise of misery, getting up, checking the post.... you get the idea.
Well, it's finally arrived! So it's down to business.
First off is getting the USB-to-serial connection working, but already I'm looking towards using the 18F range of PIC microcontrollers which have built-in USB support. For now, the FTDI chip is working a treat and LEDs are flashing perfectly in line with the serial data that's being squirted down the wire.
Send it a letter "A" and the 1st and 7th LEDs light up a treat.
The letter "J" and the 7th, 4th and 2nd LEDs glow in all their glory.
Beautiful.

For the non-binary literate, here's what happens:
The character received by the serial port is sent as a single byte.
Each character has it's own byte (ascii) code. "A" is 64, "J" is 74 for example.
So when "J" is sent, the PIC micro receives the number 74.
The number 74 represented in binary is 01001010
The LEDs are wired to the output PORTA of the PIC micro so that when the number 74 is sent to the outputs, the 7th, 4th and 2nd pins are "high" and the corresponding LEDs light up.

For a quick lesson in binary, see the forum post here.

0 Comments

Post a Comment

whos.amung.us

Copyright © 2009 .Nerd Club All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive Supported by Blogger Templates.