Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Single wire UART connection
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Simon Wilks  
View profile  
 More options Nov 18 2012, 7:14 am
From: Simon Wilks <sjwi...@gmail.com>
Date: Sun, 18 Nov 2012 13:14:37 +0100
Local: Sun, Nov 18 2012 7:14 am
Subject: Single wire UART connection

I am making good progress on the HoTT telemetry support and am now at the
point where I want to send messages back to the receiver from the PX4 in
response to its poll requests.

The thing is, HoTT receivers use a single wire (@19200, 8N1). Up until now
I have had it connected to the RX port of the PX4 which works fine. Now I
want to connect the the TX port as well. This not surprisingly doesn't seem
to work straight off.

Any suggestions as to what I do I need to do to make this work? Do I need
to enable/disable transmit/receive modes somehow?

Thanks,
Simon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Bouwens  
View profile  
 More options Nov 18 2012, 7:36 am
From: Robert Bouwens <bouwens.m...@gmail.com>
Date: Sun, 18 Nov 2012 13:36:11 +0100
Local: Sun, Nov 18 2012 7:36 am
Subject: Re: [px4users] Single wire UART connection

hi,
i have my hott system on my desk - nothing connected to it.

but you need to have an artificial delay between characters send.
not 19'200 baud - for the bits yes, but between bytes you have to wait 2ms
before you try to acces the bus again.

i hope you have succes!

best robert

2012/11/18 Simon Wilks <sjwi...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Wilks  
View profile  
 More options Nov 18 2012, 7:42 am
From: Simon Wilks <sjwi...@gmail.com>
Date: Sun, 18 Nov 2012 13:42:32 +0100
Local: Sun, Nov 18 2012 7:42 am
Subject: Re: [px4users] Single wire UART connection

Hi,

Yep, I have all of that implemented. The receiver polls twice per device
with a 200ms window each. On receiving a request a 5ms period of silence on
the line must be respected and after the byte stream can be returned with a
2-3ms delay in between each single byte.

I am just not sure how to make the hardware level stuff work. Just
connecting the wire to UART2's TX and RX port isn't enough as things just
hang.

Thanks,
Simon

On Sun, Nov 18, 2012 at 1:36 PM, Robert Bouwens <bouwens.m...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Bouwens  
View profile  
 More options Nov 18 2012, 7:55 am
From: Robert Bouwens <bouwens.m...@gmail.com>
Date: Sun, 18 Nov 2012 13:55:33 +0100
Local: Sun, Nov 18 2012 7:55 am
Subject: Re: [px4users] Single wire UART connection

hi,
now i am puzzled.
from what i hear you do it right.

i hope to activate my hott transmitter soon.
will report when i am lucky...

2012/11/18 Simon Wilks <sjwi...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Wilks  
View profile  
 More options Nov 18 2012, 6:11 pm
From: Simon Wilks <sjwi...@gmail.com>
Date: Mon, 19 Nov 2012 00:11:26 +0100
Local: Sun, Nov 18 2012 6:11 pm
Subject: Re: [px4users] Single wire UART connection

OK, after lots of reading and trying different things out I worked it out:

uint32_t cr;
cr  = getreg32(STM32_UART5_CR1);
cr |= (USART_CR1_RE); // turn on RX
cr &= ~(USART_CR1_TE); // turn off TX
putreg32(cr, STM32_UART5_CR1);

uint32_t cr;
cr  = getreg32(STM32_UART5_CR1);
cr &= ~(USART_CR1_RE); // turn off RX
cr |= (USART_CR1_TE); // turn on TX
putreg32(cr, STM32_UART5_CR1);

My logic probe is showing my data returning almost correctly...getting
closer now :)

On Sun, Nov 18, 2012 at 1:55 PM, Robert Bouwens <bouwens.m...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
PX4 Developer  
View profile  
 More options Nov 18 2012, 6:32 pm
From: PX4 Developer <p...@purgatory.org>
Date: Sun, 18 Nov 2012 15:32:17 -0800
Local: Sun, Nov 18 2012 6:32 pm
Subject: Re: [px4users] Single wire UART connection

I think my mail server ate an earlier reply - at any rate, if you hook this up, wire it to a device-specific IOCTL and we'll see if we can get NuttX to accept it upstream.

On Nov 18, 2012, at 3:11 PM, Simon Wilks <sjwi...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Wilks  
View profile  
 More options Nov 18 2012, 7:43 pm
From: Simon Wilks <sjwi...@gmail.com>
Date: Mon, 19 Nov 2012 01:43:13 +0100
Local: Sun, Nov 18 2012 7:43 pm
Subject: Re: [px4users] Single wire UART connection

No problem. Forced me to dig into stuff and learn ;)

One other question: This protocol seems pretty sensitive to timing.
Currently I am using usleep() to pause between each byte sent (about 3ms is
the goal) but I am getting considerable variations from 1.5ms to 4.5ms.
What is the best way of improve the timing without hogging the CPU?

Thanks,
Simon


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
PX4 Developer  
View profile  
 More options Nov 18 2012, 7:56 pm
From: PX4 Developer <p...@purgatory.org>
Date: Sun, 18 Nov 2012 16:56:15 -0800
Local: Sun, Nov 18 2012 7:56 pm
Subject: Re: [px4users] Single wire UART connection

What are the constraints around timing?  Reliable serial pacing is nontrivial.

On Nov 18, 2012, at 4:43 PM, Simon Wilks <sjwi...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Wilks  
View profile  
 More options Nov 18 2012, 8:05 pm
From: Simon Wilks <sjwi...@gmail.com>
Date: Mon, 19 Nov 2012 02:05:49 +0100
Local: Sun, Nov 18 2012 8:05 pm
Subject: Re: [px4users] Single wire UART connection

I am not sure how strict it has to be. I guess for testing I could run just
this daemon and give it full priority and once it works start backing off
to see where its limits are.

By definition it should have a 5ms window (and no less) between receiving
the request and responding. The response should have 2-3ms pauses between
each byte.

There is a minimum that should not be undercut but I am not sure what the
upper limit is and if it is OK if it varies per byte. Right now I am just
working on the the receiver obtaining the message correctly (so I want
things as perfect as possible for now) and then I will see how it behaves
with less strict conditions.

Attaching some screenshots for fun. If it is not a timing issue then I just
have something small that needs tweaking and it all should work.

Thanks,
Simon

  screenshot2.png
103K Download

  screenshot1.png
107K Download

  telemetry.png
87K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Wilks  
View profile  
 More options Nov 19 2012, 6:48 pm
From: Simon Wilks <sjwi...@gmail.com>
Date: Tue, 20 Nov 2012 00:48:51 +0100
Local: Mon, Nov 19 2012 6:48 pm
Subject: Re: [px4users] Single wire UART connection

Good news for Graupner HoTT owners...it works! HoTT telemetry is on its way.

Attached is a photo of the MX-20 main screen showing battery voltage
(7.0V), altitude (320m) and baro temperature (31 deg). Not bad for starters
but of course there will be more to come.

I have also attached the logic probe readings from an Electric Air Module I
have and finally what got the PX4 to generate (the same only one of them is
zoomed out a bit more). It turns out even the EAM idle times vary but I
think keeping somewhere above a minimum is fine.

Time to clean up the code, do some more testing and get a first basic
version submitted.

Simon

  mx-20_px4_telemetry.jpg
54K Download

  telemetry_eam.png
101K Download

  telemetry_px4.png
99K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »