Rs232 display driver

Use this section to discuss your embedded Flowcode projects.
Post Reply
ianjoh
Posts: 8
http://meble-kuchenne.info.pl
Joined: Sat Jan 30, 2021 3:42 pm

Flowcode v10 Rs232 display driver

Post by ianjoh »

Early stage of a project to drive a Message Maker Led matrix display.

I can display a message string, and clear it using hex sent from a byte array as it is only 10 bytes.
The hex required to send default settings so I can change to font colour is much longer at 40 plus bytes so I thought I could use a LUT but I am unable to send just hex data as a byte without conversion to ascii.
I must be missing something obvious!
There is a lot of disabled code at the moment but this is just so I can do one thing at a time. Ultimately I will read ascii sent to the 232 input and put it out to the Led display so I am following another post on here regarding 485 transmission, much to learn.
Thanks Ian
Attachments
rs232tx_DRIVER.fcfx
(24.47 KiB) Downloaded 64 times

BenR
Matrix Staff
Posts: 1769
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 450 times
Been thanked: 611 times

Re: Rs232 display driver

Post by BenR »

Hello,

Hex is just a good way of showing binary numbers, so no need to convert to ascii you can simply send the hex data. On the MCU there is no distinction between decimal or binary or hex, it's all just binary. The various number systems are there to help you interact with the machine easier.

For example here is an array of 10 bytes I am filling with hex (or other) data type. This can then be sent direct using the UART send byte array function.


data[0] = 58
data[1] = 0x3A
data[2] = 0b00111010
...
data[9] = 0xFC


Note in my example data array positions 0, 1 and 2 all have the same value they are just loaded using different number systems Decimal, Hex (0x) and Binary (0b).

So where you are pulling data from the lookup table you can simply call send char and not SendHexNumber which is designed to convert a binary value into a hexadecimal ascii string.

What are you trying to interact with and maybe we can help to create a couple of macros to show how to easier interact with it in a managable way. Do you have links to the datasheet.

ianjoh
Posts: 8
Joined: Sat Jan 30, 2021 3:42 pm

Re: Rs232 display driver

Post by ianjoh »

Thank you for your reply Ben
I understand it better now, I have set the UART to send char and changed the LUT data format to suit and it is now sending as expected but not yet changing the font colour so I need to look at and tweak what I am sending.
The display and its "bolt on" PIC based driver are from a redundant care home call system, I have installed hundreds of these previously and they are now being replaced so its a good opportunity to rescue some and reverse engineer the data using a Picoscope RS232 serial decoder and reprogram the driver PIC. I can send and clear messages OK so a good start!
There is no data sheet for this Messagemaker display as a download as they are supposed to be run from a PC using a Sigma Play app.

Regards
Ian

medelec35
Matrix Staff
Posts: 1478
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 522 times
Been thanked: 479 times

Re: Rs232 display driver

Post by medelec35 »

Hi Ian.
Have you thought of using Flowcode in PC Developer mode to directly send data to the display.
That will save you from having keep compile send to target etc.
There are example projects here
For example 3-Channel Temperature Logger - PC Developer
& Serial Comms Worked Example - PC Developer
Martin

ianjoh
Posts: 8
Joined: Sat Jan 30, 2021 3:42 pm

Re: Rs232 display driver

Post by ianjoh »

Hi Martin
That is a fab idea, thanks for the introduction!

Regards Ian

medelec35
Matrix Staff
Posts: 1478
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 522 times
Been thanked: 479 times

Re: Rs232 display driver

Post by medelec35 »

You're welcome.
PC developer (and Web developer) are great additions to Flowcode as they are very useful indeed.
Martin

Post Reply