UART: "Send in succession"

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

Moderator: Benj

MJU
Posts: 429
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

UART: "Send in succession"

Postby MJU » Mon Jun 03, 2019 5:38 pm

I'm playing with a E32-868T20D Lora module.

The first test isn't a succes.
I'm trying to get the module return it's settings by sending C3+C3+C3.
This should return the settings for the module.

I see that with my logic analyser there are 3 times "195" send by my Arduino, the pin that indicates that the module is doing something responds, but the module doesn't return data.
That do they mean with "send in succession"?

In my FC V8 i have 3 macro components for the UART that send 0xC3, is this what they mean with "in succession"?
I use the standard settings for the UART, these are (I think) what they ask: 9600 8N1 (and M0 and M1 are tied to +5V)..

What am I doing wrong?

MJU
Posts: 429
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: UART: "Send in succession"

Postby MJU » Mon Jun 03, 2019 6:40 pm


chipfryer27
Posts: 164
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 99 times
Been thanked: 63 times
Contact:

Re: UART: "Send in succession"

Postby chipfryer27 » Mon Jun 03, 2019 7:56 pm

Hi

I'm not familiar with Arduino so can't comment much on it.

Usually "in succession" means that whatever you send is sent as a complete message. On page 13 of the instruction manual it gives a couple of examples (isn't Chinglish a wonderful language?) and it appears that the space is used as a separator. So if that is the case you would send C3 C3 C3 as one message, not C3 three separate times.

Hope this helps.
Regards
These users thanked the author chipfryer27 for the post:
MJU (Mon Jun 03, 2019 10:52 pm)
Rating: 5.26%
 

kersing
Valued Contributor
Valued Contributor
Posts: 1873
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 530 times
Been thanked: 1040 times
Contact:

Re: UART: "Send in succession"

Postby kersing » Mon Jun 03, 2019 8:29 pm

Looking at the documentation you are sending the right sequence.

What voltage is the Arduino you are using? If 5V you might need to add pull-ups to RX and another signal (according to the manual see page 6 at the bottom)
These users thanked the author kersing for the post:
MJU (Mon Jun 03, 2019 10:47 pm)
Rating: 5.26%
 
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

MJU
Posts: 429
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: UART: "Send in succession"

Postby MJU » Mon Jun 03, 2019 10:47 pm

chipfryer27 wrote:Hi

I'm not familiar with Arduino so can't comment much on it.

Usually "in succession" means that whatever you send is sent as a complete message. On page 13 of the instruction manual it gives a couple of examples (isn't Chinglish a wonderful language?) and it appears that the space is used as a separator. So if that is the case you would send C3 C3 C3 as one message, not C3 three separate times.

Hope this helps.
Regards


Thank you chipdfryer, I've tried sending C3 followed by a space but no reply.
I've tried sending "195 195 195" as a string, "C3 C3 C3" as a string, nothing works.

If it wasn't for the strange translation, things wouldn't be this difficult.

MJU
Posts: 429
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: UART: "Send in succession"

Postby MJU » Mon Jun 03, 2019 10:52 pm

kersing wrote:Looking at the documentation you are sending the right sequence.

What voltage is the Arduino you are using? If 5V you might need to add pull-ups to RX and another signal (according to the manual see page 6 at the bottom)


I've added a pull up to the RX but it was always logic high (5V).
I've tried a resistor based level converter from in the RX line but no avail.

The thing is that what ever I try, the AUX pin goes low.
For me this is a sign that the module sees the message, but doesn't understands it...

Any more ideas?

chipfryer27
Posts: 164
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 99 times
Been thanked: 63 times
Contact:

Re: UART: "Send in succession"

Postby chipfryer27 » Tue Jun 04, 2019 12:25 am

Hi

Not having an Arduino I'm unsure as to their needs and operation but I'm sure you will have all the usual suspects such as timing etc in hand.

My interpretation of the manual (which may not be the case) is that the Aux pin seems to have a few uses.

1) It goes low 2mS before the E32 unit transmits to a uC and stays low for the duration of the transmission.

2) When high you can transmit data from the uC to the E32 unit for a maximum of 512 bytes, if exceeded the pin goes low to indicate
buffer full (perhaps similar to CTS/RTS).

3) It goes low during POST and during any reconfiguring.

So if my understanding is correct, after power up and assuming you are not reconfiguring, it should only go low when transmitting to your microcontroller, or if you try and send more than 512 bytes at once.

What Mode are you in? It looks like you need to be in Mode 3 (Sleep) for configuring which is both M0 and M1 high. Do you have a terminal program on your PC/Laptop? With that set to default 9600 / 81N you should be able to send C1C1C1 (hex) and get the status of the module returned. You will need level shifting too of the Tx/Rx pins. If you don't have a level shifter, at a push you could try a resistor around 4 or 5K in series with the E32 Rx pin.

Things to try with Terminal connected and in Mode 3.
After powering what is the status of Aux pin? It should be high after self test (which is only a few mS). If not then perhaps something is wrong with the module or a bad M0/M1 connection? Assuming it is high, try sending C1C1C1 (hex). Does it respond with anything? You could try swapping Tx/Rx pins as they may not be labelled correctly.

Regards

MJU
Posts: 429
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: UART: "Send in succession"

Postby MJU » Tue Jun 04, 2019 10:44 am

chipfryer27 wrote:Hi

Not having an Arduino I'm unsure as to their needs and operation but I'm sure you will have all the usual suspects such as timing etc in hand.

I think this is OK, I've added a few flashing leds in the project and they seem to work..

chipfryer27 wrote:My interpretation of the manual (which may not be the case) is that the Aux pin seems to have a few uses.

1) It goes low 2mS before the E32 unit transmits to a uC and stays low for the duration of the transmission.

2) When high you can transmit data from the uC to the E32 unit for a maximum of 512 bytes, if exceeded the pin goes low to indicate
buffer full (perhaps similar to CTS/RTS).

3) It goes low during POST and during any reconfiguring.

So if my understanding is correct, after power up and assuming you are not reconfiguring, it should only go low when transmitting to your microcontroller, or if you try and send more than 512 bytes at once.

This is also what I think after ready the datasheet..

chipfryer27 wrote:What Mode are you in? It looks like you need to be in Mode 3 (Sleep) for configuring which is both M0 and M1 high. Do you have a terminal program on your PC/Laptop? With that set to default 9600 / 81N you should be able to send C1C1C1 (hex) and get the status of the module returned. You will need level shifting too of the Tx/Rx pins. If you don't have a level shifter, at a push you could try a resistor around 4 or 5K in series with the E32 Rx pin.

M1 and M0 are tied to the +5V, so they are 1.
This is sleepmode which is the mode that needs to return the settings when asked by the C3's.

chipfryer27 wrote:Things to try with Terminal connected and in Mode 3.
After powering what is the status of Aux pin? It should be high after self test (which is only a few mS). If not then perhaps something is wrong with the module or a bad M0/M1 connection? Assuming it is high, try sending C1C1C1 (hex). Does it respond with anything? You could try swapping Tx/Rx pins as they may not be labelled correctly.

I'm going to test further.
But many of the things you write have been tested.

I see on my logic analyser that the C3's are being send.
During this sending AUX goes low. My guess is that the module sees the request, but doesn't understand it.

I've attached the Flowcode project for you all to review.
Maybe it's something that I didn't see in the settings.
I see the 9600 rate, but where are the 8N1 settings?

Thanks again for your help!
Attachments
Uitlezen config1.fcfx
(12.68 KiB) Downloaded 28 times

chipfryer27
Posts: 164
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 99 times
Been thanked: 63 times
Contact:

Re: UART: "Send in succession"

Postby chipfryer27 » Tue Jun 04, 2019 3:35 pm

Hi

Traveling just now and don't have a copy of FC on this laptop (I really should do though...).

From memory, in the UART properties you will have an option to set baud (9600), an option to set the data (8 bits) then further down an option to set flow control (no). With that you should be able to communicate.

When trying out new modules I try and take unknowns out of my equation. In this instance, as I know for sure my PC Terminal program works over my USB to Serial converter (with level shifting and the adapter only cost about five pounds, if that) I will establish communications using it first as it is so much easier to change parameters there and see what happens straight away rather than reprogram a chip.

With your analyser can you monitor both Tx and Rx at the same time? I have an 8-channel one so I would be tempted to monitor Tx/Rx and the Aux pin to see what happens in relation to each other. Before you transmit is the Aux high and when transmitting does it go low until your transmission stops? What happens if you send the first byte (C3 or whatever) then pause before sending the second byte? Does the Aux pin return to high? If so you could try to either incorporate a delay between sending characters or monitor the Aux pin and only send one character when high.

Chinglish manuals have a habit of omitting important facts (and they may not actually refer to the product, rather cut & paste from something else). I didn't see much on the web either for support but I did see they have a configuration tool. Perhaps download that and monitor what is being sent to the chip with your analyser? You would then be certain of the format.

Regards

MJU
Posts: 429
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: UART: "Send in succession"

Postby MJU » Tue Jun 04, 2019 5:26 pm

chipfryer27 wrote:Hi

Traveling just now and don't have a copy of FC on this laptop (I really should do though...).

From memory, in the UART properties you will have an option to set baud (9600), an option to set the data (8 bits) then further down an option to set flow control (no). With that you should be able to communicate.

When trying out new modules I try and take unknowns out of my equation. In this instance, as I know for sure my PC Terminal program works over my USB to Serial converter (with level shifting and the adapter only cost about five pounds, if that) I will establish communications using it first as it is so much easier to change parameters there and see what happens straight away rather than reprogram a chip.

With your analyser can you monitor both Tx and Rx at the same time? I have an 8-channel one so I would be tempted to monitor Tx/Rx and the Aux pin to see what happens in relation to each other. Before you transmit is the Aux high and when transmitting does it go low until your transmission stops? What happens if you send the first byte (C3 or whatever) then pause before sending the second byte? Does the Aux pin return to high? If so you could try to either incorporate a delay between sending characters or monitor the Aux pin and only send one character when high.

Chinglish manuals have a habit of omitting important facts (and they may not actually refer to the product, rather cut & paste from something else). I didn't see much on the web either for support but I did see they have a configuration tool. Perhaps download that and monitor what is being sent to the chip with your analyser? You would then be certain of the format.

Regards


Again thank you for your answers.
When sending the 0xC3's, the AUX goes from high to low status, as I would imagine.
I've tried monitor the TX pin and the RX, but the module never answers the C3's..

I tried changing pins on my analyser and get the same reply... none.
Also, if I monitor the module via a terminal program, the 195195195 is send, but no reply.

I will search for the configuration tool and get back..

chipfryer27
Posts: 164
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 99 times
Been thanked: 63 times
Contact:

Re: UART: "Send in succession"

Postby chipfryer27 » Tue Jun 04, 2019 5:40 pm

Hi

Try here

http://www.ebyte.com/en/data-download.a ... d=196#load

Maybe the Ebyte Configuration Tool? One of the other manuals under a different piece of kit is using the same module, and it had a screenshot of the config tool. With it you select your PC com port, connect, then change whatever parameter you wish. If you have a USB to Serial you could perhaps monitor what comes out and in what format?

If it can connect etc then you know the issue is within the Arduino.

Regards

chipfryer27
Posts: 164
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 99 times
Been thanked: 63 times
Contact:

Re: UART: "Send in succession"

Postby chipfryer27 » Tue Jun 04, 2019 10:05 pm

Hi

Just got back but off again tomorrow.

Looking at your program the UART settings seem good but I think the problem may lie in how you are sending C3 etc. You are using the command SendNumber which sends your value as a string of digits. So you sending C3/195 sends out the value 0x31/49, 0x39/57 then 0x35/53 so the module would not see C3/195 but each individual digit that makes it up.

If you set up the console on UART1 and enable (UART properties, console = yes) you can see this.

If you use the command SendChar it sends out the value as it is, i.e. 0xC3 / 195. Again the console will confirm this.

I attached a screenshot.

Hope this helps
Regards
Attachments
Capture.JPG
Capture.JPG (60.34 KiB) Viewed 848 times
These users thanked the author chipfryer27 for the post (total 2):
MJU (Wed Jun 05, 2019 3:24 pm) • medelec35 (Wed Jun 05, 2019 5:13 pm)
Rating: 10.53%
 

MJU
Posts: 429
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: UART: "Send in succession"

Postby MJU » Wed Jun 05, 2019 3:24 pm

chipfryer27 wrote:Hi

Just got back but off again tomorrow.

Looking at your program the UART settings seem good but I think the problem may lie in how you are sending C3 etc. You are using the command SendNumber which sends your value as a string of digits. So you sending C3/195 sends out the value 0x31/49, 0x39/57 then 0x35/53 so the module would not see C3/195 but each individual digit that makes it up.

If you set up the console on UART1 and enable (UART properties, console = yes) you can see this.

If you use the command SendChar it sends out the value as it is, i.e. 0xC3 / 195. Again the console will confirm this.

I attached a screenshot.

Hope this helps
Regards


OHHH MY!!!
This works! Thank you again chipfryer!

But I don't seem to learn. I saw 195 195 195 clearly on my logic analyser so I thought that I was doing it the right way.

Thanks again for anyone who helped me!

chipfryer27
Posts: 164
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 99 times
Been thanked: 63 times
Contact:

Re: UART: "Send in succession"

Postby chipfryer27 » Wed Jun 05, 2019 5:13 pm

Hi

Glad to hear it works.

My cheapo USB logic analyser can operate in many ways / protocols. Depending on setup it could easily look as though it is "reading" 195 over a time period but if I expand it out I might then see three individual characters over x-microseconds or the like.

Anyway, moot point now as you have it working. I'd be interested to know how you get on with the modules especially in terms of range and any corruption of data. I'm guessing that you will probably only be sending a few bytes at a time. I've been using modules from RF Solutions with good results so I'm really quite interested to hear about the performance of these units.

Regards

MJU
Posts: 429
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 105 times
Been thanked: 94 times
Contact:

Re: UART: "Send in succession"

Postby MJU » Wed Jun 05, 2019 5:19 pm

chipfryer27 wrote:Hi

Glad to hear it works.

My cheapo USB logic analyser can operate in many ways / protocols. Depending on setup it could easily look as though it is "reading" 195 over a time period but if I expand it out I might then see three individual characters over x-microseconds or the like.

Anyway, moot point now as you have it working. I'd be interested to know how you get on with the modules especially in terms of range and any corruption of data. I'm guessing that you will probably only be sending a few bytes at a time. I've been using modules from RF Solutions with good results so I'm really quite interested to hear about the performance of these units.

Regards


I will learn from this! Thank you.

Now I can read the module it is time to get things over the air.
First I'm breaking down the datasheet so I can change settings fast.
I'm working on a Excelsheet with only dropdownboxes that give me the right settings for my tests.
Only the CHAN option is strange because in the 868Mhz datasheet it calculates with 433Mhz as base frequency..

I will, as always, share my project as soon as it is up and running.
I hope that other people can benefit from my work.

I will try and test it as soon as I can and share my results!

chipfryer27
Posts: 164
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 99 times
Been thanked: 63 times
Contact:

Re: UART: "Send in succession"

Postby chipfryer27 » Wed Jun 05, 2019 6:21 pm

Hi

I see what you mean re the channel number, obviously the section has been cut and pasted from the 433 Module which gives it's base as 410MHz. Default values for the 433 module seem to be C0 00 00 1A 17 44 with the fifth byte the channel number in Hex (17 or 23 in decimal). Subtracting decimal from 433 gives the 410MHz base. This 410MHz corresponds to the lower ISM frequency for that band as per manual.

Section 2.2 of the 868 manual states the ISM operating range of 862 to 893MHz so my guess is that 862 is the base for your module.

It may be worth trying the following if the unit is still in default. If you read the current settings by sending C1 C1 C1 you should receive a six byte sequence. The fifth byte is the channel number in Hex. If you subtract the decimal equivalent from 868 you may get lucky and find you hit a base of 862. Alternatively add it to 862 to find your channel. Certainly worth a shot.

I don't think it matters too much as long as all the modules you intend to link are using it and the channel is relatively free from other interference.

Regards