Semiduplex asynchronism serial 10bit

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Semiduplex asynchronism serial 10bit

Post by MJU »

Hello there,

I don't have access to all my resources right here and that confuses me.
I'm playing with a device that has this in it's "datasheet":
UART1.jpg
UART1.jpg (69.29 KiB) Viewed 3613 times
Is this the UART component that I need to use?
57600bps seems UART. But the 10bit confuses me.

I don't have a working logic analyser here so I don't know what is happening on the RX/TX lines.
Do I need to use the UART further or do the Chinese people mean something else?

Any help is welcome..

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by MJU »

BTW: is sending 0xFFFFFFFF the same as sending 4 times 0XFF in a row?
How do I send 0XFFFFFFFF via UART?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by medelec35 »

Hi MJU,
What about using flowchart posted here to send ULong to UART rather than to EEPROM?
Martin

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by kersing »

This is just a difficult way to describe 8n1, so you can use use the regular uart component with 8 bits, no parity and 1 stop bit.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by MJU »

medelec35 wrote:
Fri Sep 04, 2020 1:05 am
Hi MJU,
What about using flowchart posted here to send ULong to UART rather than to EEPROM?
Thank you Medelec,

But in that example you want to write 1234567890 to the eeprom.
For that you need to separate the ULONG number to 8bits and store them in the EEPROM.
But if I only want to store 0xFFFFFFFF, isn't it better to send 4 times 0xFF in a row?
Or in that example 0x499602D2 (=1234567890 dec) as 0x49 0x96 0x02 0xD2?

In my calculation there is no need to separate the ULONG in bytes if the above method works.
But I don't have my logic analyser so I can't see the response.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by medelec35 »

Yes 4 in a row if always the same value.
I was assuming the value would vary?
If that was the case, store as ulong then send bytes within a loop.
I can't take credit for this (Thanks Ben), but you could even send in a string like this

Code: Select all

"\xFF\xFF\xFF\xFF"
Martin

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by MJU »

medelec35 wrote:
Fri Sep 04, 2020 4:48 pm
Yes 4 in a row if always the same value.
I was assuming the value would vary?
If that was the case, store as ulong then send bytes within a loop.
I can't take credit for this, but you could even send in a string like this

Code: Select all

"\xFF\xFF\xFF\xFF"
Thank you, I will try this string way of sending.

I first need to make sure I send the data in the right way, maybe tomorrow I can get a hold on my logic analyser again and then I can follow what is happening on the bus.

I want to send this code: 0xEF01 FFFFFFFFH 01H 03H 14H 0018H so I thought to send these UART sendchars 0xEF 0x01 0xFF0xFF0xFF0xFF 0x01 0x03 0x14 0x00 0x18 right behind each other..

Is that a proper way to test this?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by medelec35 »

If not got an analyser working, you can use Tera Term to view bytes instead of ASCII.
It needs to run in debug mode:
As you can see the 0x00 and 0x18 is not displayed as I believe the compiler is treating the 0x00 as a null terminator.
Attachments
Tera Term Debug Mode.png
Tera Term Debug Mode.png (3.21 KiB) Viewed 3565 times
Martin

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by MJU »

medelec35 wrote:
Fri Sep 04, 2020 5:39 pm
If not got an analyser working, you can use Tera Term to view bytes instead of ASCII.
It needs to run in debug mode:
As you can see the 0x00 and 0x18 is not displayed as I believe the compiler is treating the 0x00 as a null terminator.
Hey Medelec, this is true!
If I send the data like I wanted to, the 0x00 and the 0x18 were not seen by my logic analyser.
After some testing I found a way to send all data with the 0x00 included.

The fact that the 0x00 was omitted, is that something to do with the UART component? Or something that the chip does?

Now I need to go back to your first post to get a kind of checksum working.
Thanks again for your help!

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by kersing »

Are you using the SendChar macro? This should send the 00. If you use SendString the 00 will be considered a string terminator and not transmitted.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

MJU
Posts: 502
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 121 times
Been thanked: 108 times
Contact:

Re: Semiduplex asynchronism serial 10bit

Post by MJU »

kersing wrote:
Sat Sep 05, 2020 6:06 pm
Are you using the SendChar macro? This should send the 00. If you use SendString the 00 will be considered a string terminator and not transmitted.
Thanks Kersing, I found this to be true.
Would a variable terminator string wouldn't be an addition to this component?

Post Reply