Exercise 15

Networking and Communications

Making PCB Board

I made this PCB board in the lab.

Also, I milled and Soldered this board. It is not a hard task.


Materials about Communications

I followed this tutorial to wire up an Arduino used as an ISP (programmer) to an ATtiny.I see the the tutorial on programming an ATtiny using the Arduino 1.0.1 software to find out how to write code for the microcontroller. I downloaded Arduino software for Mac OS X.

I use the Arduino board to program the ATtiny. First, i turned the Arduino board into an “in-system programmer” (ISP). To this:

1.Run the Arduino development environment.

2.Open the ArduinoISP sketch from the examples menu.

3.Note for Arduino 1.0: you need to make a small change to the ArduinoISP sketch before uploading it. Find the line in the heartbeat() function that says “delay(40);” and change it to “delay(20);”.

4.heartbeat() function that says “delay(40);” and change it to “delay(20);”.

5.Select the board and serial port that correspond to your Arduino board.

6.Upload the ArduinoISP sketch.


Coding

I coded onn the software.


Connecting

Now how to connect the attiny44 and the HC-06? This is done by connecting the RX and the TX port of the attiny44 (which you have defined in your code) to the RX and TX port of the HC-06 Bluetooth Module. But different to how you usually connect a VCC port to another VCC port you now need to remember what RX and TX are for. A small reminder: RX is for input and TX is for output. So if we would connect the RX port of the attiny to the RX port of the HC-06 bluetooth module both ports would wait for input which they will never get. What we need to do is connect the TX port of the attiny44 to the RX port of the HC-06 bluetooth module and the RX port of the attiny44 to the TX port of the HC-06 bluetooth module. Like this

I connected the 3 board and downloaded program as a ISP.I need to provide power to the ATtiny and connect it to my programmer. That is, connecting MISO, MOSI, SCK, RESET, VCC, and GND of the programmer to the corresponding pins on the ATtiny.