Go Down

Topic: Interfacing an arduino pro mini 3,3v to a Raspberry Pi GPIO (Read 383 times) previous topic - next topic

RIN67630

I would like to connect an Arduino pro mini 3,3v to a Raspberry Pi GPIO for programming and operative use of the serial /tty/AMA0 port.

The Raspberry Pi and the Arduino pro mini are both remote, so I have no option to push manually the reset button to programm.

Has someone got instructions on how to wire the Arduino pro mini 3,3v to a Raspberry Pi GPIO serial and how to configure AVRdude to automatically send a reset to a given GPIO pin?

I have asked the question on the Raspberry Forum as well, but they are not very friendly to Arduino lovers....

ron_sutherland

#1
Jan 11, 2018, 11:41 pm Last Edit: Jan 11, 2018, 11:42 pm by ron_sutherland
Quote
Push manually the reset
First: Do you want to use the Pi as an ISP tool or to have it act as a host and do the serial bootload thing?

This circuit board (a shield) shows how I have connected my AVR boards to a Pi Zero.  I use the serial bootload option, so I enable Pi's CTR/RTS lines and use RTS through a .1uF capacitor to the reset line (e.g. the DTR serial bootload trick) and avrdude works just like it does on my other computers (which use DTR rather than RTS).

https://github.com/epccs/RPUpi/



Some notes I have to set up the Pi Zero when testing (e.g. they are for Jessie, I need to update to Stretch).

https://github.com/epccs/RPUpi/blob/master/Hardware/Testing/linux.md

It is a complex setup but I think you first need to decide if you want the Pi to be an ISP or a host computer that can serial bootload.

ron_sutherland

#2
Jan 11, 2018, 11:52 pm Last Edit: Jan 12, 2018, 06:00 am by ron_sutherland
Well, that bus manager is going to confuse, I did not consider that... it intercepts the Pi's RTS and uses that to do the DTR capacitor trick.

Also, the RS422 stuff is going to confuse. I guess this is not going to help much.

RIN67630

First: Do you want ... have it act as a host and do the serial bootload thing?
Yes. I would like to work as if it were connected over USB, but without the bulky USB stuff.


This https://github.com/openenergymonitor/avrdude-rpi appears to address the problem.
Unfortunately it must be run separately as root and is not itegrated into the IDE, which makes it unhandy.

ron_sutherland

#4
Jan 12, 2018, 11:05 pm Last Edit: Jan 13, 2018, 11:18 pm by ron_sutherland
To allow a hardware UART on a Pi Single Board Computer to interface with an AVR UART the following connections can be used. Notice that the AVR is powered by 3.3V.




BMC17 is the RTS pin from Pi if it is enabled, it will then do the (DTR) bootloader trick that Arduino does with the Uno.

AVR board: perhaps a Pro Mini https://www.sparkfun.com/products/11114 or Pro Trinket https://www.adafruit.com/product/2010

Update: There is nothing to integrate into the IDE, it just works. Both boards I looked at have the needed capacitor to start the bootloader on a FTDI header.

Update: The pull-up from the AVR to the Pi shutdown was a bad idea so I removed it.

RIN67630

BMC17 is the RTS pin from Pi if it is enabled, it will then do the (DTR) bootloader trick that Arduino does with the Uno.

Thank you, can you tell, how to enable it on the Pi?

ron_sutherland

#6
Jan 14, 2018, 07:58 pm Last Edit: Jan 14, 2018, 08:15 pm by ron_sutherland
I used this program

https://github.com/mholling/rpirtscts

It tells how to build and use it on that page.

The program can be run at startup by adding it to rc.local

https://www.raspberrypi.org/documentation/linux/usage/rc-local.md

I suspect there is or will someday be a setting in the Pi software itself but did not find one if you find it please post what it is.

Go Up