Forums › Devices › OSD335x-SM › OSD335x-SM UART3 connection to Atmeg2560
In my PCBs i have a OSD335x-SM connection to Atmeg2560 via UART3. I have uploaded firmware to the Atmega using an ISP Programmer with no errors( i loaded firmata). I have loaded a new Beaglebone Black IoT image on the SD card and it is loading and booting fine. The board that has the OSD335x-SM is running and i can get an IP and connect to it with putty. I can also connect through the USB port i have on my board. All looks good with that. Now i am trying to verify the connection to the Atmeg2560 via UART3. the Beaglebone image has Node-Red installed so i used that to try to get access to the I/O provided by the Atmeg2560. Node-Red does detect 6 tty connections (/dev/ttyS0 – 5). I have tried all of these to gain access to the Atmega and none of them work. In node-red it just indicated no connection.
I am wondering if there is some command i can run in putty to show me what is or is not enabled or connected. Is all of the UARTs enable by default or do i need to enable them manually. Is there a debug log or report that can show me that the Atmega is on the other end of UART3?
I can connect a standard Arduino MEGA to the PCB usb port and Node-Red can see that one and i can get I/O from it as well. I just doesn’t see the one i have on board connected to UART3
I’m posting here just in case its one of those stupid things i missed – like yes, you need to go in and enable it or something like that.
Hi Gary,
From the schematics you provided us, the Atmega2560 looks like it is connected to pins (A13, B13) which are pins for UART2 and not UART3.
The interface does need to be enabled in device tree. You can also specify a device tree overlay to instantiate the UART interface. For this, you will need to modify uEnv.txt located on /boot folder. You will need root privileges to modify this file. So, make sure you are root.
I made 2 modifications to this file:
1. uncommented uboot_overlay_addr0 and specified BB-UART2-00A0.dtbo as the device tree overlay(changes shown below)
1 2 3 4 5 6 | ###Overide capes with eeprom uboot_overlay_addr0=/lib/firmware/BB-UART2-00A0.dtbo #uboot_overlay_addr1=/lib/firmware/.dtbo #uboot_overlay_addr2=/lib/firmware/.dtbo #uboot_overlay_addr3=/lib/firmware/.dtbo ### |
2. Commented the line to enable universal cape(shown below).
1 2 | ###Cape Universal Enable #enable_uboot_cape_universal=1 |
Then I rebooted the board. I was able to see that UART2 was available as ttyO2:
1 2 3 | root@beaglebone:/var/lib/cloud9# ls -l /dev/ttyO* lrwxrwxrwx 1 root root 5 Mar 20 16:16 /dev/ttyO0 -> ttyS0 lrwxrwxrwx 1 root root 5 Mar 20 16:16 /dev/ttyO2 -> ttyS2 |
In order to test the interface, I used a UART to USB FTDI cable and connected it to my computer. I monitored the connection using Putty with baud rate 9600.
On the board, I installed minicom which is a serial console program.
1 | sudo apt-get install minicom |
I ran the following command to start a communication terminal on the board.
1 | root@beaglebone:~# minicom -D /dev/ttyO2 -b 9600 |
I then input some characters and verified that they were showing up on my computer’s Putty terminal.
Hope this helps,
Please let us know if you have any more questions.
This was very helpful and i appreciate it very much. You are right, it is UART2. My schematic was incorrectly labeled as UART3. I can see the extra UART now. This did not solve my issue with the communication with the Atmega chip using Node-Red but at least I’m closer to the solution.
Thank You
Octavo Systems LLC all rights reserved
OCTAVO is registered in the U.S. Patent and Trademark Office. OSD, C-SiP, and the Octavo Logo are trademarks of Octavo Systems LLC.
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields
"*" indicates required fields