Here is how I see the week's flow :
To get closer to this week's network and communication concepts and potential, I feel that recreating from scratch my own version of Neil's Hello.bus would be just fine.
So I will make three boards : a bridge and two nodes, all three linked with a bus and ATtiny45 based.
The physical link will be a 4 wires ribbon cable
The communication protocol will be serial at 9600 baud
The addressing will be done by hardcoding a different address in each firmware of each microcontroller
The testing will be done by typing board addresses into a terminal on the master computer and waiting for their respective answers.
Here is a diagram of the architecture of my network :
Table of content :
I draw schematics in Eagle :
First, the bridge board :
Then the node board, which is basically the same as the bridge board wigh the FTDI connector removed :
From the schematic I layout the boards :
Again, the node board is the same as bridge board with FTDI connector removed.
Then I export a black and white PNG representing the top copper layer
the bridge board :
I duplicate the node traces in three and make it only one PNG to mill three boards at once.
I use fabmodules to generate the gcode :
The bridge board :
And the node boards :
Unfortunately, the third node board was milled outside of the stock I had, so I got only two.
Also, at some point, the monofab failed. It was stopping in the middle of the milling process saying it has not enough power.
It's true that it has been doing a lot of unexpected vibration noise recently.
So I suspected it was coming from the rotor.
I find out that the rotor axis is worn out (not anymore circle) where it goes in the bearing.
And the bearing itself, a simple plain bearing that looks like brass metal, is very loose :
So I replaced the motor by another one that was lying around in the lab :
Only problem is that the new motor doesn't have the same power and the same speed.
So I have to systematically set the speed to 50% of was it usually is :
Aside from this, after all these training weeks, the process was very smooth and quick.
Again, it's faster and faster to gather the components and solder them...
Here are my three boards, populated :
Compare to Neil's design, I have pin 3 and pin 4 inverted, so I need to change that in the code :
I also understood a very simple thing : PB0,1,2,3... are actually predefined names in the avr/io.h header for, well, 1,2,3...
Also, I understood that the PGM_P macro is predefined in the avr/pgmspace.h header and is used to declare a variable that is a pointer to a string in program space.
Then, just to believe that I'm original, I change the initial 1,2,3 addressing by a,b,c :
So I have as many firmwares as there are different addresses, here, 3
It seems that I'm experiencing this for the first time but even though my board is working, if I try to use the "burn bootloader" command from the arduino IDE to set the fuses, the microcontroller doesn't respond anymore. It's impossible to communicate with it anymore. Would be glad to know if others are also experiencing this.
I first make sure that the right microcontroller is selected in the Makefile :
I then compile my C program in a .hex file and upload them to the ATtiny45 with these commands :
sudo make
sudo make program-usbtiny
I just have to plug the fabISP serial ribbon cable in each of the board and upload the right (with the right hardcoded address) firmware :
Through the FTDI cable, I'll send addresses and should see the according hardcoded board flash twice.
I use term.py to send those serial characters. I start the terminal with this command :
sudo python term.py /dev/ttyUSB0 9600
Here it is in action :
I noticed that when I try to have two programs opening the same serial port on a virtual machine, it can lead to this :
Here are the sources files of the projects I talked about on this page :
***