cpusa
08-07-2008, 12:10 PM
I'm trying to modify the Transparent Master example to work at 115200.
initUart(1, 115200) gives me the following error message:
Int out of range.
Does the Uart support 115200 baud or is there a alternate constant that I should be using?
Thanks,
Tom Johnson
"""Sample script for the multi-drop serial master device.
Load this script into the MASTER device. It will broadcast serial data to the SLAVE devices,
and periodically announce its MASTER status to all.
"""
from switchboard import *
# Maximum number of hops allowed for multicast forwarding
numHops = 3
secondCounter = 0
def startup():
# Initialize UART
initUart(1, 115200) # was 9600 baud
flowControl(1, False) # No flow control
# Connect UART to transparent data endpoint.
# The default transparent configuration is broadcast
crossConnect(DS_UART1, DS_TRANSPARENT)
# Enable bridge connections on the other UART
crossConnect(DS_UART0, DS_PACKET_SERIAL)
def announceMaster():
"""Broadcast master status. This allows slaves to learn our address, so they can unicast back."""
mcastRpc(1, numHops, 'master')
def poll100ms(mstick):
global secondCounter
# Periodically announce 'master' status to all slaves
secondCounter += 1
if secondCounter >= 10:
announceMaster()
secondCounter = 0
snappyGen.setHook(SnapConstants.HOOK_STARTUP, startup)
snappyGen.setHook(SnapConstants.HOOK_100MS, poll100ms)
initUart(1, 115200) gives me the following error message:
Int out of range.
Does the Uart support 115200 baud or is there a alternate constant that I should be using?
Thanks,
Tom Johnson
"""Sample script for the multi-drop serial master device.
Load this script into the MASTER device. It will broadcast serial data to the SLAVE devices,
and periodically announce its MASTER status to all.
"""
from switchboard import *
# Maximum number of hops allowed for multicast forwarding
numHops = 3
secondCounter = 0
def startup():
# Initialize UART
initUart(1, 115200) # was 9600 baud
flowControl(1, False) # No flow control
# Connect UART to transparent data endpoint.
# The default transparent configuration is broadcast
crossConnect(DS_UART1, DS_TRANSPARENT)
# Enable bridge connections on the other UART
crossConnect(DS_UART0, DS_PACKET_SERIAL)
def announceMaster():
"""Broadcast master status. This allows slaves to learn our address, so they can unicast back."""
mcastRpc(1, numHops, 'master')
def poll100ms(mstick):
global secondCounter
# Periodically announce 'master' status to all slaves
secondCounter += 1
if secondCounter >= 10:
announceMaster()
secondCounter = 0
snappyGen.setHook(SnapConstants.HOOK_STARTUP, startup)
snappyGen.setHook(SnapConstants.HOOK_100MS, poll100ms)