hart protocol implementation

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everybody,

I'm trying to implement a hart protocol on my device. As you know it is a FSK based communication  on a 4-20mA current loop. I'm using Atxmega128 and DS8500(maxim hart modem).
I can send and receive simple characters and modem converts them into FSK perfectly. My main problem is with timing. if anyone had implement it before me I'll be glad to hear some advise on it.
Any suggestions which makes this path more clear are welcome.

 

Best Regards

In the end it doesn't even matter ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tzanti wrote:
My main problem is with timing.

 

What timing? 

 

tzanti wrote:
if anyone had implement it

 

What it???

 

Please tell us what your trying to talk to and what the problem is, from the above post we are unable to assist you.

 

Jim

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for your prompt answer,

 

"What timing? "

 

There should be a time which calculates very small times like 1 ms. and its easy to make it with timers but I want to know about the exact timings , I just know there are some timings.

 

"What it???"

It refers to hart protocol as I mentioned at the beginning.  

 

In the end it doesn't even matter ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Must be a language barrier, as I still don't know what the problem is.  

The HART protocol is well documented and there are no timings with the protocol itself.  https://en.wikipedia.org/wiki/Hi...

The instruments you want to communicate with may have timing requirements, but you will need to research the datasheets for each to see what they are if any are needed. 

 

Perhaps if you explained what it is your attempting to do, i.e. trying to command a control value made by E&H model #xyz to control the flow of water to a storage tank.....

Jim

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think you assume we know about hart protocol. Most of us probably don't, so you're going to have to show us the hart standard regarding these 'timings'.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Presumably the DS8500 handles the details of the protocol itself?

 

So the question is more about the interface to the DS8500.

 

So what does its datasheet say?

 

Don't Maxim provide App Notes and/or example code for using their chip?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
So the question is more about the interface to the DS8500. So what does its datasheet say?

Indeed, the datasheet doesn't come right out and say it but it appears to be straightforward UART at 1200bps.  8,e,1 or 8,o,1 -- can't tell even or odd from the datasheet.

 

A lot easier than when I "bit-banged" it years ago using a timer and CTC mode, with a cap to take the edges off the square wave output.

 

 

awneil wrote:
Presumably the DS8500 handles the details of the protocol itself?

Hmmm---we may need to define "protocol" here.  In my mind, HART is a method of signalling.  I'd say analogous to RS-232 or RS-485, e.g.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@awneil said:

Presumably the DS8500 handles the details of the protocol itself?

@theusch said: 

it appears to be straightforward UART at 1200bps.

 

I don't think so, the DS8500 appears to be a modem, plain and simple. 

 

 

@tzanti said:

There should be a time which calculates very small times like 1 ms. and its easy to make it with timers but I want to know about the exact timings , I just know there are some timings.

Huh?  How do you "know" there "are some timings?"

 

Greg Muth

Portland, OR, US

Xplained Boards mostly

Atmel Studio 7.0 on Windows 10

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Greg_Muth wrote:
I don't think so, the DS8500 appears to be a modem, plain and simple.

I guess. "Modulator/Demodulator".

 

So no different than an RS-232 driver, in concept?

 

Figure 2 illustrates an example waveform of the DS8500

in modulate mode. The data to be modulated is pre-

sented in a UART format (start, 8 data bits, parity, stop

bit) at D_IN. FSK_OUT shows the modulated output.

"Example" and "presented" means that the "character frames" need not be those of a common UART?

 

Still, for OP, it appears to me that the AVR's UART at 1200bps should be used.  Along with control signal handling.

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@theusch said:

 

t appears to me that the AVR's UART at 1200bps should be used

 

+1.  Don't know what the "timing" issues are... 

Greg Muth

Portland, OR, US

Xplained Boards mostly

Atmel Studio 7.0 on Windows 10

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you all for your comments.

 

DS8500 is only a modem and it just provides requirements of physical layer it has nothing to do with the code part and it dose not provide any application or software or anything.

I need to use this modem through the micro via USART to communicate as a Hart device.

 

whole procedure is analog based. so we need to demodulate all the commands and modulate our responses with exact timing any mistake in timing cause fail in connection.

DS8500 datasheet has a simple structure and it has a very clear pin definition. 

 

one of my problems is when i'm transferring data , I'm checking TX_counter , is it a proper way to check if the sending is finished ?

after early cycles my transfer buffer become full and I lost connection.

what should i check for transfer procedure's end ?

 

best regards

 

In the end it doesn't even matter ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Never used an xmega, but the usart should have a tx complete flag. I gather you're talking about the transmit enable (RTS) for the modem.

Last Edited: Thu. Jul 27, 2017 - 05:27 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is not a flag or I can't find it. Yes RTS(Request to send) pin is the controler part of DS8500.

U can choose to be in modulating mode or demodulating mode. 

In the end it doesn't even matter ...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

TXCIF in the status register.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everybody,

 

Guys I wanted you to know that the problem is solved. It was not about timing problem, modem was working perfectly. 

Main problem was on my response. Combination of bytes were not accurate.

 

Thank you all for your kind answers

 

Best Regards 

In the end it doesn't even matter ...