Program an Arduino from a Raspberry Pi using UART - arduino

I am trying to program an Arduino mounted on a breadboard using a Raspberry Pi.
For the setup of the Arduino I have been following this tutorial, except from the USB-serial device. Instead I have the Raspberry Pi connected through a level converter. I designed the level converter myself using a 4066 analog switch and an op-amp as a voltage follower to supply a stable 3.3V voltage. The 3.3V from the Pi is converted to 5V on the Arduino pins, and vice versa. I am not getting any response from running avrdude in the shell or through the Arduino IDE on the Pi.
Both the Pi and the Arduino are driving their TX pins to high value (3.3V and 5V). The Arduino has been flashed with a bootloader in a stk500 development board. The command I have been running is:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega8 -carduino -P/dev/ttyAMA0 -b9600 -D -Uflash:w:/tmp/build4533291593992176675.tmp/sketch_mar21a.cpp.hex:i
LED connected to pin13 flashed aproximately every 6 seconds.
Can anyone tell me how I can get the Raspberry Pi talking to the Arduino?

Fairly stumped. First thing I'd try is just to check that RX/TX communication is working. Write a simple program to read and write on arduino pins 2 and 3 and something similar on the PI.
Other things to look at http://arduino.cc/en/Main/StandaloneAssembly. You might be able to do things using AVR see http://arduino.cc/en/Hacking/Programmer.
There is a new arduino stack exchange https://arduino.stackexchange.com/ it might be worth asking there.

Related

Raspberry Pi to Arduino GPIO wire length

I want to connect a Raspberry Pi 3 to an Arduino via there IO pins so the Pi can send control commands to the Arduino.
The distance between the two devices is around 10 feet (around 3 meters), is this viable using the IO port or is the gap too long? I haven't been able to find the specific specifications for this when I searched.
Thank you in advance xx
The length of the wires is not an issue, but be careful because the GPIO pins of the Pi are 3.3V and the pins of the Arduino are 5V. So be sure to use a level converter between the Pi and the Arduino or you will probably fry your Raspberry.
If you want to send the commands over Serial you also have to connect the RX of the Pi to the TX of the Arduino and vice versa.

Difference in I2C Reading Arduino and Raspberry

I tried to read my sensor data from my Raspberry Nano W(2017) via I2C and UART, but without success. Afterwards I tried via my Arduino Uno R3 and here it worked.
I am not that familiar with the SW-Differences, but is there the possibility, that the EEPROM on my Sensor only works with Arduino and is not compatible with the Raspi I am using?
Or I am just too stupid to get it running via my Raspi?
BR

Use Arduino board as regular AVR microcontroller

I want to use ATmega2560 MC, but it manufactured only as surface mount IC which means i must make PCB to use it. I searched for a per-made kit and found Arduino Mega R3 board contains the desired MC. (It contains less I/O pins but that's OK for now). Can i implement my code (without any arduino code) in this board? or should i modify it to work with Arduino, also if it runs in the board will it be the same as normal IC or there will be differences in speed.
The MCU in the Arduino Mega2560 is a stock ATmega2560. There is no need to use the Arduino libraries to program it and no need to use the Arduino tools to communicate with it; avr-gcc and avrdude will work with it as normal. Note that you will need to select the appropriate programmer/protocol in avrdude for the bootloader programmed on the chip if you want to program it via serial rather than ISP.

Is it possible to use Arduino 2560's serial/USB communication without Arduino bootloader?

I have an Arduino 2560 and would like to send serial data to my PC. However, I am currently not using the Arduino Bootloader because I wanted to use a program that I wrote for an Atmega644 before (as far as I understood, one has to use the Arduino language when using the Bootloader?).
Does anyone know if what I am trying to do is possible with reasonable effort?
Connection to PC via 2560's serial0 does not depend on bootloader (if you plan connection when main program is running). You need 16u2 running to bridge 5V serial UART to USB or you can of course use any other option (e.g. MAX232 or so) to convert 5V UART to USB or RS232. But in case of RS232 double check baud rate error because of 16MHz crystal for particular baudrate.
2560 bootloader just implements firmware flash.

Arduino bootloader sequence

I have put together a Bareduino which is an ATmega328 on a breadboard. I have a transceiver chip (MAX233) connected to it and to my serial port adapter on my laptop. I haven't been able to upload any sketches yet. What is the bootloader sequence? Does the Arduiono send out a character first or does the IDE? What is it looking for?
I have a manual reset button. The ATmega328 comes with a bootloader and a program already in it to blink an LED on D13 (chip pin 19). The LED is blinking on and off at one second intervals so it appears to be running. I have ordered an FTDI board, but I scrounged up a MAX233 and thought I would give it a try. Sorry, not a coding question, but I am interested in learning about the bootloader sequence.
On bootlup, the Arduino waits for a signal from the IDE, if it doesn't get one, it runs the local program. Are you getting timeouts? Are you selecting the right com port and board type? depending on the boot loader installed on your chip, try duemilanove or uno. do you have the capacitor for auto reset installed?
see http://www.instructables.com/id/The-Embedded-Arduino-building-an-Arduino-into-a-p/

Resources