hlxldb

LED光立方制作全过程(十七)

0
阅读(3979)

Step 31Build the controller: clock frequency

Build the controller: clock frequency

Build the controller: clock frequency

 

Build the controller: clock frequency

Build the controller: clock frequency

We use an external crystal of 14.7456 MHz to drive the ATmega system clock.

You may be thinking that this is an odd number to use, and why we didn't run the ATmega at the 16MHz it is rated for.

We want to be able to control the LED cube from a computer, using RS232. Serial communication requires precise timing. If the timing is off, only by a little bit, some bits are going to be missed or counted double from time to time. We won't be running any error correcting algorithms on the serial communications, so any error over the line would be represented in the LED cube as a voxel being on or off in the wrong place.

To get flawless serial communication, you have to use a clock frequency that can be divided by the serial frequency you want to use.

14.7456 MHz is dividable by all the popular RS232 baud rates.

  • (14.7456MHz*1000*1000) / 9600 baud = 1536.0
  • (14.7456MHz*1000*1000) / 19200 baud = 768.0
  • (14.7456MHz*1000*1000) / 38400 baud = 384.0
  • (14.7456MHz*1000*1000) / 115200 baud = 128.0

The formula inside the parentheses converts from MHz to Hz. First *1000 gives you KHz, the next Hz.

As you can see all of these RS232 baud rates can be cleanly divided by our clock rate. Serial communication will be error free!

 

Step 32Build the controller: protoboard soldering advice

Build the controller: protoboard soldering advice

 

We see people do a lot of weird stuff when they solder on prototype PCBs. Before you continue, we just want to share with you the process we use to create tracks on prototype PCBs with solder eyes. Once you master this technique, you will probably start using it a lot.

1) Fill each point of the track you want to make with solder.
2) Connect every other points by heating them and adding a little solder.
3) Connect the 2-hole long pieces you now have spanning the desired track.
4) Look how beautiful the result is.

You can see in the video how we do it. We had to touch some of the points twice to join them. It was a bit hard to have the camera in the way when we were soldering ;)
 
(备注:不解释,flash没办法看见了)
 
 
翻译版链接地址:http://group.chinaaet.com/218