I'm generating a high rate of errors 10-20% when sending messages out via xbee
connected to UART but only when I use PWM at the same time. I'm using UART2 and
I've tested this behavior using all of the other available PWM pins. Below is a
piece of simplified code that has a high error rate. When I comment out the
section that turns the PWM signal on, the UART/xbee sends messages pretty much
faultlessly.
What is the fix to eliminate the high error rate?
import Adafruit_BBIO.UART as UART
import Adafruit_BBIO.PWM as PWM
import serial
from time import sleep
duty = 5.
pwm_freq = 60
polarity = 1
pin = "P9_16"
UART.setup("UART2")
PWM.start(pin, 100. - duty, pwm_freq, polarity)
ser = serial.Serial(port = "/dev/ttyO2", baudrate = 9600)
ser.close()
for i in range(30):
message = "hello world"
ser.open()
if ser.isOpen():
ser.write(message)
else:
print('message unsent - serial port could not be opened')
ser.close()
sleep(0.1)
PWM.stop(pin)
PWM.cleanup()
Kernel 8.1.13
Debian Wheezy 7.11
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/34cd0e90-8a9c-425b-be38-3fb0ad20f3c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.