Ham Radio
Ham Radio, Electronics, Software and more...

Home » Electronics » AVR Microcontrollers » Brightsign Serial Communications with Atmel Microcontroller (Brightsign Serial Communications with Atmel Microcontroller)
Brightsign Serial Communications with Atmel Microcontroller [message #3301] Mon, 18 January 2021 12:04
kc2nda is currently offline  kc2nda
Messages: 47
Registered: December 2004
Location: New Paltz
Member
Brightsign Serial Communications with Atmel Microcontroller

/projects/BrightSign/BrightSign_Serial_Testing_Microcontroller.jpeg

Receiving serial data was a problem. The Brightsign kept crashing. In case anyone else is having these problems... This line was missing in my serial setup:

s.serial0.SetUserData("0")

So the serial initialization was:

Function newreboot(msgPort As Object, userVariables As Object, bsp as Object)
print "newreboot"

s = {}
s.version = 0.1
s.msgPort = msgPort
s.userVariables = userVariables
s.bsp = bsp
s.ProcessEvent = reboot_ProcessEvent
s.clearvalues = saveserial_clearvalues
s.objectName = "reboot_object"
s.debug = true

'serial instance creation...
s.serial0 = CreateObject("roSerialPort",0,9600)
s.serial0.SetBaudRate(9600)
s.serial0.SetMode("8N1")
s.serial0.SetUserData("0")
s.serial0.SetLineEventPort(msgPort)

return s
End Function

'----------------------------------------------------------- --------------

There error messages I was receiving was:

[ 222.175] Script runtime error: Type Mismatch. (runtime error &h18) in SD:/autorun.brs(13522)

[ 222.175]

[ 222.175] Press SVC to debug.



Adding this line to the serial port configuration fixed the crashing. To find the problem if your unit is rebooting with the 10 red error flashes, you can log into the web interface and look at the log file before the unit reboots. Or you can telnet into the device and watch the output.


Here are some tests to show the BrightSign was sending the correct information:

This picture was using a serial com port on a Dell computer:
/projects/BrightSign/BrightSign_Serial_Communications.jpeg

This picture was using the BrightSign XT1144; You can see the voltage is higher than the com port of a computer. The BrightSign sending data to the microcontroller board via the 3.5mm serial (sending an ascii 48 or a "0"):
/projects/BrightSign/Brightsign_Ascii_Serial_Communications.jpeg

[Updated on: Mon, 05 April 2021 15:20]

Report message to a moderator

Goto Forum:
  


Current Time: Thu Aug 18 03:32:23 EDT 2022

Total time taken to generate the page: 0.04342 seconds