The Raspberry Pi is equipped with many interfaces.
And the possibilities can rise more than exponentially by using of the USB port.
But to communicate with AVR microcontrollers is the best suited way by using a serial interface.
Of course, the Raspberry Pi A has a serial interface, but unfortunately merely as pins on the GPIO connector.
The required pins, could be connected theoretically directly to the microcontroller eg. ATMega8.
But that would require that the microcontroller operates at 3.3 volts.
My Pollin evaluation board works with 5 volts, but is made with a complete RS232 interface for communication with PC or other equipment.
The easiest way would it be, when the Pi would have an RS232 interface like a PC with the same connectors and signal levels.
By Googling I’ve found the website Serial Port Add On.
The described Serial Port to TTL Digital Converter Module there, I’ve bought at Ebay.
|GPIO Header Pins|
|1= 3.3V, 9= GND, 8= TX, 10= RX|
The jumper cables to connect to the Raspberry Pi were included in the delivery.
I’ve connected the module with the Pi, as shown in the picture below.
To get the serial interface up and running, are some changes in/etc/inittab and /boot/cmdline.txt necessary.
- comment line: ‘T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100’
#Spawn a getty on Raspberry Pi serial line #T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100
- delete of: dwc_otg.lpm_enable=0
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
pictures of my PI inclusive ‘serial device’
Video, for Demonstration
For that I’ve written a little perl script. Surely it is possible to use programs like minicom, but I dont wanted to spend the time to familiarize myself with a new tool.
The script was written faster and from my perspective it’s much more flexible for further use and for experiments.