Serial Communication on Beaglebone Black

3,748 views
Skip to first unread message

Shaurabh Kumar Singh

unread,
May 18, 2016, 4:46:20 PM5/18/16
to BeagleBoard
I have been trying to communicate with a CNC machine through RS 232 to the Beaglebone Black. 
Following are the Serial Port settings at the Machine
Baudrate=9600
Databits=8
Stopbits=1
Parity=None
CR only

When i tried connecting it to my desktop(windows 10-using python) directly(done without using BBB) and i set the same parameters i got the response from the machine like i had expected.

Although, when done using the BBB (debian), also using python, i just received the string command i sent to the machine. Following is the python code.

import Adafruit_BBIO.UART as UART

import serial, string

UART.setup("UART1")
with serial.Serial(port="/dev/ttyO0",baudrate=9600,timeout=2) as ser: #i also tried mentioning databits and stopbits and other parameters but they still did not work
        ser.write(b"Q100\r")
        c=ser.readline().decode("utf-8","ignore")
        print(c)
        ser.close()

This works all fine in windows(gives the serial no. as the output) but simply gives back     Q100    as output (same as input).

I was wondering if it could be due to the different OS on my laptop and BBB. Should i try installing windows ce on the BBB and work with that?


Thank you

Mark Lazarewicz

unread,
May 18, 2016, 9:56:09 PM5/18/16
to beagl...@googlegroups.com
Ask for a refund from ncsu.edu you have been cheated 


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/8ea4c1d1-b702-4bcc-869b-b2106af130e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ts

unread,
May 19, 2016, 3:37:24 AM5/19/16
to BeagleBoard
You need to activate the serial port first.
http://beaglebone.cameon.net/home/serial-ports-uart

Shaurabh Kumar Singh

unread,
May 19, 2016, 11:26:44 AM5/19/16
to BeagleBoard
Yes i have already tried activating the serial ports as shown in the link before. Still it did not seem to work.

Wally Bkg

unread,
May 19, 2016, 4:40:30 PM5/19/16
to BeagleBoard
What kernel and image?

newer ones use config-pin to activate the UARTS and seem to have problems with some of the overlays.

On:  BeagleBoard.org Debian Image 2015-11-12 with kernel: 4.1.18-ti-r49 #1 SMP PREEMPT Fri Feb 26 00:12:54 UTC 2016 armv7l GNU/Linux

It boots "cape-universal" and I enable UART1 wtih:
sudo config-pin P9.24 uart
sudo config-pin P9.26 uart

Before going too far, jumper RX to TX and test it with minicom, the default echo on will double type any keys you press in the console, and with echo off you get no response without the jumper and get the character with it installed.

Shaurabh Kumar Singh

unread,
May 19, 2016, 6:41:53 PM5/19/16
to BeagleBoard
BeagleBoard.org BeagleBone Debian Image 2014-04-23
Linux beaglebone 3.8.13-bone47 #1 SMP Fri Apr 11 01:36:09 UTC 2014 armv7l GNU/Linux

I am fairly new to beaglebone, could you tel me how to configure the cape-universal overlay.

Shaurabh Kumar Singh

unread,
May 19, 2016, 6:57:21 PM5/19/16
to BeagleBoard
I did try to configure it using "config-pin overlay cape-universal" but it said
Loading cape-universal overlay
bash: line 0: echo: write error: File exists
Error loading device tree overlay file: cape-universal

What do i do

Shaurabh Kumar Singh

unread,
May 19, 2016, 6:58:01 PM5/19/16
to BeagleBoard

Wally Bkg

unread,
May 19, 2016, 7:35:43 PM5/19/16
to BeagleBoard
I'm not big on Python, but it looks like you are using some of the Adafruit libraries,  they are broken for some kernels, I'm not the guy to tell you if your current kernel is one of them.

To isolate the problem, do:
apt-get install minicom and jumper RX to TX.  

I think by default in Debian images you need to run minicom as root.   
From my command history when I was playing with uart1:
sudo minicom -D /dev/ttyS1

OTOH your python script may also need to run as root with the default device permissions.

If minicom works (after you've jumpered TX to RX) you know the overlay is loading correctly, and the problem is either the Python library or the permissions your scripts runs with.

If minicom doesn't work the overlay is not loading correctly.  There has been a fair number of threads about what uart overlays to use with various kernels try some searching.

Hope this helps.

Shaurabh Kumar Singh

unread,
May 19, 2016, 8:08:55 PM5/19/16
to BeagleBoard
Okay. I shall look it up. 
By the way, i did confirm the working of the UART pins(UART1 RX to UART4 TX and vice versa). 
I had two terminal tabs open and when i typed into one and entered(UART1 settings) it showed up on the other terminal with UART4 settings. I inferred that the Adafruit libraries work just fine for the BBB (correct me if i am mistaken)

It is just that while interacting with a CNC machine(with a HAAS OS) it is not communicating rather just showing up what is being sent.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/Z1s_NwXYNrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/3e26cffd-df67-4867-8775-7e3716ea1af0%40googlegroups.com.

Wally Bkg

unread,
May 20, 2016, 8:19:07 AM5/20/16
to BeagleBoard
On Thursday, May 19, 2016 at 7:08:55 PM UTC-5, Shaurabh Kumar Singh wrote:
Okay. I shall look it up. 
By the way, i did confirm the working of the UART pins(UART1 RX to UART4 TX and vice versa). 
I had two terminal tabs open and when i typed into one and entered(UART1 settings) it showed up on the other terminal with UART4 settings. I inferred that the Adafruit libraries work just fine for the BBB (correct me if i am mistaken)

It is just that while interacting with a CNC machine(with a HAAS OS) it is not communicating rather just showing up what is being sent.

You may need CTS or DTR active for the other end to accept data and respond.  Are you sure the CNC machine doesn't need a "hardware handshaking" protocol?

If you have uart1 talking to uart4 on the Beaglebone, that says the problem is the physical connection and/or the protocol to the CNC machine.  Is the CNC machine wired to be DTE or DCE?

At this point I think you need help from the CNC machine's documentation, or from someone familiar with that particular machine.

Shaurabh Kumar Singh

unread,
May 20, 2016, 8:36:15 AM5/20/16
to beagl...@googlegroups.com

The cnc is dte as far as I know.
And I am assuming since it worked without hardware handshaking on my pc, it shouldn require the same for the bbb either.
That said, I have tried both the settings. With and without hardware handshaking.
The only thing I can think of is for some reason perhaps, the default serial port settings must be different on the bbb (with debian) than my pc (where I previously successfully had communicated-windows)

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/Z1s_NwXYNrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Wally Bkg

unread,
May 20, 2016, 10:08:09 AM5/20/16
to BeagleBoard

You do realize that on your PC the RS232 signal levels from the COM ports are +/- 12V while without extra hardware the Beaglebone levels are 0-3.3V?  You may have fried the RX input on the Beaglebone if you've connected it directly to a +/- 12V RS232 TX output.

Assuming you've got the logic levels right, If you used a "standard" serial cable on your PC to the CNC machine it probably activated the CTS or DTR automatically,  you may need to run one more wire from the Beaglebone,  or tie it active on the CNC interface side.

evilwulfie

unread,
May 20, 2016, 10:31:59 AM5/20/16
to beagl...@googlegroups.com
if he connected it to the cnc with no 3.3v adapter it also could have fried the bbb.
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/30ad5a80-4c6b-453b-b74b-c63f010996c4%40googlegroups.com.

Shaurabh Kumar Singh

unread,
May 20, 2016, 11:11:47 AM5/20/16
to BeagleBoard
The RX and TX at the beaglebone are working just fine. The TX output from the RS-232 is 5V.  Also i tried with and without connecting the red wire(5V) from the RS 232. The necessary connections are GND (black wire) , RX and TX(green and white wires) of the PL2303 USB to Serial adapter. 
I also tried using a BeagleBone Black RS-232 Serial Micro-cape (see http://www.logicsupply.com/cbb-ttl-232/).

Note: RX and TX are working just fine for all the UART ports.(i confirm after every try)

Shaurabh Kumar Singh

unread,
May 20, 2016, 11:15:00 AM5/20/16
to BeagleBoard
CTS and DTR were not activated at the PC interface, i had looked up the serial port settings on which it was working. Anyway i did try with and without both and individually as wel. 

Shaurabh Kumar Singh

unread,
May 20, 2016, 11:18:08 AM5/20/16
to BeagleBoard
Do you guys think i should also try a FTDI USB to Serial Adapter for BBB? It might eliminate the voltage issue altogether.

evilwulfie

unread,
May 20, 2016, 11:19:47 AM5/20/16
to beagl...@googlegroups.com
the output from the bbb is 3.3v not 5v. if you use anything other than some kind of level translator you risk harming your BBB

it talks about that in the BBB srm.

Shaurabh Kumar Singh

unread,
May 20, 2016, 11:24:08 AM5/20/16
to BeagleBoard
I anyway could not find any previous work on serially connecting to a machine with BBB. I might have to shift to intel NUC. Do you think using FTDI USB to serial adapter is worth taking the risk? Is there anything different you suggest i could do perhaps?

Harvey White

unread,
May 20, 2016, 11:49:43 AM5/20/16
to beagl...@googlegroups.com
On Fri, 20 May 2016 11:11:39 -0400, you wrote:

>The RX and TX at the beaglebone are working just fine. The TX output from
>the RS-232 is 5V. Also i tried with and without connecting the red
>wire(5V) from the RS 232. The necessary connections are GND (black wire) ,
>RX and TX(green and white wires) of the PL2303 USB to Serial adapter.
>I also tried using a BeagleBone Black RS-232 Serial Micro-cape (see
>http://www.logicsupply.com/cbb-ttl-232/).
>
>Note: RX and TX are working just fine for all the UART ports.(i confirm
>after every try)

Even though you check after each try, putting a signal over 3.3 volts
on the BBB pins (or 1.8 volts on the analog pins) is just asking for
trouble.

Good engineering says not to put too much voltage on processor pins.

5 volts on a 3.3 volt maximum pin is too much. You may or may not
have overstressed the pins, which may or may not fail sooner or later.

If you are in college, and you have not been told this, then you need
to speak to your professors. Data sheet maximum ratings are not
suggestions.

You need the ground and the RXD and TXD lines. The maximum voltage on
the RXD and TXD lines should be 3.3 volts, on the average adaptor,
there's a jumper for that. There's also a jumper to select a 5 volt
swing. You do not need either the 3.3 volt power line or the 5 volt
power line.

Harvey
>>>> <https://groups.google.com/d/msgid/beagleboard/3b9db8f5-b454-4801-b4a5-49a867c0e255%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> https://groups.google.com/d/
>>>> msgid/beagleboard/3b9db8f5-b454-4801-b4a5-49a867c0e255%
>>>> 40googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>> For more options, visit http://beagleboard.org/discuss
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "BeagleBoard" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to beagleboard...@googlegroups.com.
>> To view this discussion on the web visit
>> <https://groups.google.com/d/msgid/beagleboard/30ad5a80-4c6b-453b-b74b-c63f010996c4%40googlegroups.com?utm_medium=email&utm_source=footer>
>> https://groups.google.com/d/msgid/beagleboard/30ad5a80-4c6b-453b-b74b-c63f010996c4%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> For more options, visit http://beagleboard.org/discuss
>> ---
>> You received this message because you are subscribed to a topic in the
>> Google Groups "BeagleBoard" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/beagleboard/Z1s_NwXYNrw/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> beagleboard...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/beagleboard/0eb51074-b51a-f658-f69c-10a7ec8aa58b%40gmail.com
>> <https://groups.google.com/d/msgid/beagleboard/0eb51074-b51a-f658-f69c-10a7ec8aa58b%40gmail.com?utm_medium=email&utm_source=footer>
>> .

Shaurabh Kumar Singh

unread,
May 20, 2016, 11:55:38 AM5/20/16
to BeagleBoard
Exactly. I did what you just said. Used the ground RXD TXD. And the examples shown online do not use the red wire(power line) at all. And that is exactly what i did. I went by the conventional method before starting to try out other things. also i later used the 3.3 V jumper. 
Do you have any suggestions on what i could perhaps try? 
Thanks

Harvey White

unread,
May 20, 2016, 1:13:08 PM5/20/16
to beagl...@googlegroups.com
rOn Fri, 20 May 2016 11:55:28 -0400, you wrote:

>Exactly. I did what you just said. Used the ground RXD TXD. And the
>examples shown online do not use the red wire(power line) at all. And that
>is exactly what i did. I went by the conventional method before starting to
>try out other things. also i later used the 3.3 V jumper.
>Do you have any suggestions on what i could perhaps try?

If you have the 3.3 volt jumper enabled, then that will protect your
processor from overvoltage.

Now I'd ask if you have RXD and TXD reversed (regardless of how the
software works, unless it can do that). Check the pins with a logic
probe, or a scope to see that the TXD is connected to the proper RXD
line.

If you have the right signals on the right lines, it's going to be
either a hardware configuration problem (in terms of what the software
is set to do) or a software problem (no drivers).

I'd also write a small routine to output characters from one to the
other to see what's going on, just test signals.

Check the destination to see what lines are active other than TXD and
RXD, you may need to duplicate them.


Note that an RS232 line level input and output are at least +/- 6
volts.

From a computer to the BBB is likely to be USB to 3.3 volts, and the
output from the BBB to the RS-232 level converter is likely to need 5
volts unless it is specified to be 3.3. It is likely that the BBB
cannot properly drive the RS-232 converter unless the converter can
tolerate that.

The input from the 5 volt RS232 converter is going to be 5 volts,
which cannot be connected to the BBB directly, it needs to go through
a level converter.

the BBB is a 3.3 volt world.

Harvey

Shaurabh Kumar Singh

unread,
May 20, 2016, 2:41:33 PM5/20/16
to BeagleBoard
Okay from what you said I guess it could be a drivers issue. The rest of it i have tried. What do you suggest if it is a driver problem?which driver and how do i install the drivers? could you perhaps tel me where to look exactly. 

Thank you

Harvey White

unread,
May 20, 2016, 6:56:29 PM5/20/16
to beagl...@googlegroups.com
On Fri, 20 May 2016 14:41:25 -0400, you wrote:

>Okay from what you said I guess it could be a drivers issue. The rest of it
>i have tried. What do you suggest if it is a driver problem?which driver
>and how do i install the drivers? could you perhaps tel me where to look
>exactly.

I've reached the limits of my expertise on this platform. Someone
else will have to answer the question.

Harvey

Bruce Boyes

unread,
May 22, 2016, 1:47:19 PM5/22/16
to BeagleBoard
If you used a straight through serial cable from your PC to the CNC then the CNC is likely DCE, since the PC serial is usually DTE. If you used a null modem cable then the CNC could be DTE. You didn't specify which cable you used.

DCE is Data Communication Equipment and originally was a device like a modem, not a Terminal or PC.  DTE, the Data Terminal Equipment was "in charge" and could control peripherals like serial modems or printers. 

A modem or DCE device generally just waits there to be told what to do. DTE connects to DCE with a "standard" cable which is just straight through since the hardware DCE and DTE ports themselves are wired such that the TXD from DTE connects to the RXD of DCE and vice versa. To connect DTE to DTE or DCE to DCE you need a "null modem" cable which swaps those pins in the cable, otherwise you have both TXD connected to each other = won't work.

What UART adapter are you using on BBB? Did I miss that information? Apologies if I just added to the confusion.

Bruce


Shaurabh Kumar Singh

unread,
May 22, 2016, 7:22:35 PM5/22/16
to BeagleBoard
@Bruce
I should have mentioned it earlier. Anyway, it is a null modem cable (DB 25 male to DB 9 female). I have tried every permutation and combination between the TxDs' and RxDs' . I am not using any adapter at the BBB. I am simply making wired connections. From the RS 232 USB end I have four wires (red,green,white,black) of which i am connecting green white and black as suggested and shown in examples available online. 
I had previously asked if i should instead use an FTDI USB to serial adapter designed for BBBs.
Also, a possibility is, as discussed earlier, the BBB might be lacking necessary drivers.


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/Z1s_NwXYNrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

evilwulfie

unread,
May 22, 2016, 7:26:45 PM5/22/16
to beagl...@googlegroups.com
we had already told you you MUST use a 3.3v translator of your choosing.
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAEh-rEGhkEakpTL4Vi3aZHg5SgTJX6ou0re75_q5%3DhQrWbSFOA%40mail.gmail.com.

Shaurabh Kumar Singh

unread,
May 22, 2016, 7:32:12 PM5/22/16
to BeagleBoard
The RS232 that I am talking about is a BeagleBone Black RS-232 Serial Micro-cape. It is indeed designed specifically for BBB. 

Shaurabh Kumar Singh

unread,
May 22, 2016, 7:33:53 PM5/22/16
to BeagleBoard
Sorry for saying the USB end on my previous post. 

evilwulfie

unread,
May 22, 2016, 7:37:08 PM5/22/16
to beagl...@googlegroups.com
so if you jumper txd and rxd you can loopback your data ?
if so the "drivers" are just fine.

time to grab a scope and troubleshoot

Shaurabh Kumar Singh

unread,
May 22, 2016, 7:41:28 PM5/22/16
to BeagleBoard
Yes i am able to do that. I am able to create serial connections but it is specifically not working with the CNC.

By serial connections i mean the following:
I jumpered the rx of UART1 to tx of UART4 and tx of UART1 to rx of UART4. 
I then opened up two terminals. One had UART1 setup and the other had UART4.
And I got the data i sent in using UART 1 terminal on the UART4 terminal and vice-versa.

Bruce Boyes

unread,
May 22, 2016, 8:28:02 PM5/22/16
to beagl...@googlegroups.com
@Shaurabh
Is this your serial adapter:

You have two of them and have modified one to be Serial 4?

Shaurabh Kumar Singh

unread,
May 22, 2016, 8:32:46 PM5/22/16
to BeagleBoard
@Bruce
Yes that is. I tried with the adapter as well as without as there are two ways of doing it. It is working fine. But specifically for the CNC connection it is not.



--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/Z1s_NwXYNrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Bruce Boyes

unread,
May 22, 2016, 8:47:10 PM5/22/16
to beagl...@googlegroups.com
@Shaurabh
OK they actually have a pretty nice document for that!

Now what is your CNC machine? What serial port document do you have for it?

The serial cape has only TXD and RXD driven, no handshake or flow control. The CNC might expect something specific. It does look like the serial cape has some of the control signals fed back, I did not study it enough and map the 5x2 ribbon cable to the DB9 to figure that out.

You would need a null modem cable between the BBB DTE serial port and the CNC DTE serial port, or you can modify the BBB serial as DCE instead. If you make the BBB as DCE, and connect a straight serial cable to your PC DTE, you should see the BBB bootloader information every time BBB powers up. And you can log in to BBB on that serial0 port too.

If things are eventually connected correctly to the CNC, it will also see the BBB bootloader information: is that OK for the CNC or will it get confused? If the CNC sends some data to the BBB during bootup it could confuse BBB.

So it might be better to use serial4, set as DCE which has no BBB debug use already.

If you do that, you could connect serial4 as DCE from BBB to your PC with a straight cable, and pretend your PC is the CNC. See if you can open a terminal on the PC and BBB and see data both ways. If so then it should work on the CNC just by moving the cable over. This assumes the CNC doesn't need some specific flow control or handshake. You might be able to disable that from the CNC side so all it needs is TX and RX.

Aren't serial ports wonderfully confusing?

At this moment I have a headache from working on code and hardware (not on BBB, we are using a Teensy ARM Cortex M4 this time) talking to a custom RS422-sort-of serial connection so I feel your pain.

Shaurabh Kumar Singh

unread,
May 22, 2016, 9:02:22 PM5/22/16
to BeagleBoard
It is confusing indeed.

I have a HAAS CNC machine. The documentation specifically states that interaction can occur only through an RS232 port.
Moving on, I connected the female DB 25 at the HAAS CNC using a null modem 25 to 9 and an RS232 to USB(initially). This connection worked perfectly when i connected it to my PC(USB at the PC). What the CNC does is: I send a command from my PC and the CNC spits back corresponding data. 
Now all of it works perfectly fine.

But now I want to replicate the entire thing on a BBB. So that instead of my PC there is BBB. 

I know the exact null modem + RS 232 works fine with my PC. But is not working at all with the BBB. 
No handshake protocols are enabled. I have triple checked that just to be sure. 
From what i think at the BBB :it should be DTE since at PC it is. I can try making it DCE.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/Z1s_NwXYNrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Bruce Boyes

unread,
May 22, 2016, 9:23:02 PM5/22/16
to beagl...@googlegroups.com
DTE on BBB will be OK as long as you have null modem cable.

Try letting your PC simulate the CNC, and get communication working between PC DTE and BBB. Then switch that PC end to the CNC.

Bruce

Harvey White

unread,
May 22, 2016, 9:50:58 PM5/22/16
to beagl...@googlegroups.com
On Sun, 22 May 2016 21:02:15 -0400, you wrote:

>It is confusing indeed.
>
>I have a HAAS CNC machine. The documentation specifically states that
>interaction can occur only through an RS232 port.
>Moving on, I connected the female DB 25 at the HAAS CNC using a null modem
>25 to 9 and an RS232 to USB(initially). This connection worked perfectly
>when i connected it to my PC(USB at the PC). What the CNC does is: I send a
>command from my PC and the CNC spits back corresponding data.
>Now all of it works perfectly fine.
>
>But now I want to replicate the entire thing on a BBB. So that instead of
>my PC there is BBB.
>
>I know the exact null modem + RS 232 works fine with my PC. But is not
>working at all with the BBB.
>No handshake protocols are enabled. I have triple checked that just to be
>sure.
>From what i think at the BBB :it should be DTE since at PC it is. I can try
>making it DCE.

One last time.

Computer USB (5 volts) to RS232 adaptor (+/- 9 volts or so). DTE or
DCE is solved by a null modem if needed.

BBB does not put out USB (in this case). BBB puts out 3.3 volts and
needs 3.3 volts. RS-232 adaptor MUST accept 3.3 volts from the BBB
and ONLY put out 3.3 volts TO the BBB.

RS-232 adaptor provides the interface to the CNC machine.

1) you MUST use an RS-232 adaptor to connect to the BBB
2) the adaptor MUST be set to produce only 3.3 volts and NOT 5.0 volts
to the BBB
3) once you figure out what the BBB is producing on what pin, and what
the CNC needs to see, connect the RS-232 adaptor accordingly.

IF the BBB is putting out signals on the TXD pin, then you have a
source to drive the RS-232 adaptor.

IF the BBB can see 3.3 volt signals on the RXD pin, then you can
listen to the CNC machine if it says anything.

I'd suggest the following:

1) oscilloscope
2) RS-232 analyzer (if needed)

The bits about CTS, RTS, CD, DSR and so can be determined from looking
at what the working interface is doing when you measure the signals at
the CNC machine's pins.

Harvey
>> <https://groups.google.com/d/msgid/beagleboard/CAC32br%2BK65pihWC4ZwDfCB8xgwNxe1pAZ2oj_RWME%3DL3KVPX%3DQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .

Bruce Boyes

unread,
May 22, 2016, 11:51:01 PM5/22/16
to beagl...@googlegroups.com
@Harvey

He is using a mini cape which does the proper voltage level shifting. Link in previous message in this thread.

Harvey White

unread,
May 22, 2016, 11:54:47 PM5/22/16
to beagl...@googlegroups.com
Thanks, then it seems to be all software from this point on. Glad
that this hardware setup will not damage the BBB.

Harvey

Shaurabh Kumar Singh

unread,
May 23, 2016, 2:23:58 PM5/23/16
to BeagleBoard
I shall try that soon @ Bruce.
Okay. Here is a logic(do not know how sensible but still).
Every time I connect at my PC it works all fine. When i connect to other systems it asks to update the driver. Unless ofcourse the driver is installed.

So i was thinking if the same applies to a BBB. Would i have to update or upgrade the driver the same way?
If so then anybody knows how to?

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/Z1s_NwXYNrw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

evilwulfie

unread,
May 23, 2016, 2:27:10 PM5/23/16
to beagl...@googlegroups.com
is this PC running windows ?
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/CAEh-rEF7C3xoUP%3DO1ho9pmQfmbT4pq%2BaifE_mqio3RW6qfuJfA%40mail.gmail.com.

Shaurabh Kumar Singh

unread,
May 23, 2016, 2:28:34 PM5/23/16
to BeagleBoard
Yes all the three i tried on.

evilwulfie

unread,
May 23, 2016, 2:30:55 PM5/23/16
to beagl...@googlegroups.com
i would say you would need WINE installed on the BBB if you want to run windows programs on the BBB
I have never tried it though so your mileage will vary

how were you running the program on the BBB if its a windows program ?

Shaurabh Kumar Singh

unread,
May 23, 2016, 2:33:51 PM5/23/16
to BeagleBoard
Okay. Well windows is simply the OS as far as its role is concerned. I am using Python 2.7 entirely to communicate. I have the same exact version of python installed on BBB as well. So i doubt if WINE would help.

evilwulfie

unread,
May 23, 2016, 2:40:57 PM5/23/16
to beagl...@googlegroups.com
well you need  scope . or a logic probe

Shaurabh Kumar Singh

unread,
May 23, 2016, 2:42:32 PM5/23/16
to BeagleBoard
Could you elaborate please.

evilwulfie

unread,
May 23, 2016, 3:08:02 PM5/23/16
to beagl...@googlegroups.com

wm.ba...@gmail.com

unread,
Nov 14, 2017, 7:33:58 AM11/14/17
to BeagleBoard
Well, I stumbled across this discussion because I just found out today after wasting hours that my Beaglebone appears to have RX and TX mislabeled (swapped). Maybe that's the source of some of the confusion that others are having, too? I am accustomed to always connecting TX to RX and vice-versa between components, but to get the Beaglebone to work with all my other serial devices (that work in the usual way with other development boards), I have to connect RX to RX and TX to TX! Mind you, this is a brand new PocketBeagle, and maybe the developers just got this one board backwards, but maybe all the BBs have the same screwy labeling?

-- Will

Jeff Andich

unread,
Nov 15, 2017, 4:49:26 AM11/15/17
to BeagleBoard
Yeah we also stumbled last-week on Tx and Rx being swapped/ ‘crossed’ for UART1 (?only?) on the BB-X15 AND TI 572x evm REVA3 schematics. The other UARTS appear fine. Details to follow.

marc.a....@gmail.com

unread,
Feb 3, 2018, 9:30:27 PM2/3/18
to BeagleBoard
I've been using a beaglebone black (in debian) to communicate with my Matsuura MC800 VF (1993). It's got an old yasnac I-80 controller on it, and I have to drip feed most stuff because I've only got about 30k of program memory. For the record I was unable to get this to work with USB to serial adapters, in both Windows and Linux. As soon as I went directly to the UART pins it was easy.

I recommend using stty to set the serial port, and the just copy the file you want to the serial port. For example, I run at 4800 baud, 7 data bits even parity 1 stop bit with software "flow control". Here's how I set the port settings for the beaglebone black:

stty -F /dev/ttyS1 4800 parenb cs7 -icrnl ixon nl1 cr1


then do something like this to copy the file to the serial port and have the beaglebone spit it out. In my case I'm using serial (uart) 1:

cp /pathtofile/mycncfile.nc /dev/ttyS1


You can do it in Python, but I'd get it working at the most basic level first. With Python there could be additional software buffers between you and the cnc machine that could cause issues.


I use a max232 between the beaglebone and the machine for level shifting. I'm currently using an old one a buddy soldered up and had laying around, but I'm going to put in a more professional max232 in the next couple days. The one I got was on Amazon link here:

https://www.amazon.com/gp/product/B00HKIMBZW/ref=oh_aui_search_detailpage?ie=UTF8&psc=1


It looks, good, but I haven't tested it yet.



Now, I've got a question for you guys. Has anyone been able to get hardware flow control working on the beaglebone black in debian?


-Marc

Jeff Andich

unread,
Feb 5, 2018, 2:41:19 PM2/5/18
to BeagleBoard
Hi,

I'm running on a BB-X15 with kernel 4.4.110-ti-r142 and Debian, 8.10 (2018-01-01).

I have not yet correctly run hardware flow control on Beagleboard-X15/BBB, but I BELIEVE I saw evidence that the non-default, OMAP serial driver (as opposed to the default 8250 serial driver) was auto-toggling the RTS line when the RTS line was using a GPIO line instead of a "dedicated RTS line" for the respective UART.  Caution: it could be that the driver was treating the GPIO line differently than the dedicated RTS line, so I need to go back and flush all of this out (unless someone on here already knows the answer)...  I also need to show you the difference in how my device tree fragment for this UART was specified.  

Furthermore, since we're doing RS485/MODBUS for our work project, our strategy (at the moment) is to manually toggle the dedicated RTS line which is connected to the "DE switch" on a 2-wire RS485 chip.  Toggling the DE switch switches whether the half-duplex RS485 chip is transmitting (e.g. UART port's Txd line is connected) or receiving  (e.g. UART port's Rxd line is connected).  One interesting thing to note, is that so long as we use a "dedicated RTS line from the UART, we can manually toggle that RTS line (in Python, for instance) regardless of whether we're using the OMAP driver or the 8250 driver. 

My BB-X15 is currently setup for UART 9.  The pinmux has been configured to expose UART9's Rxd, Txd, RTS, and CTS. I just need a good, easy way of testing hardware flow control maybe in some kind of real time data exchange.  So maybe something like a Python program running on both my PC and my BB-X15 which boomerangs back what the other party sends???

I will TRY to test this this week in my spare time, but there's some stuff at work and outside of work this week which could easily necessitate pushing this back..  So bare with me, and follow-up if I drop the ball. 

Thanks! 

Jeff
Reply all
Reply to author
Forward
0 new messages