This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/EK-TM4C123GXL: Modbus RTU via UART

Part Number: EK-TM4C123GXL

Tool/software: Code Composer Studio

Hey,

I want to implement a Modbus RTU Master on the EK-TM4C123GXL with RS485. I have to use the UART for that (needed additional hardware is available). I want to transfer and receive four different messages over the bus. The UART is already configuered with the Baud rate und Parity and Stop bit.

Now I don't know how to go on. I already downloaded the FreeModbus library, but I don't know where to start and what I need.

I hope you can give me some advice how I can possibly implement the Modbus.

(I hope my english is not too bad and you understand what i wrote)

LG

  • There appear to be multiple (versions) of "FreeModbus library" - have you checked to confirm that "yours" lists the "TM4C123" as compatible? That would be your "first order of business" - I would think.

    Will just 4 different messages satisfy, "All of your needs?"    If so - how did you (or others) choose those?    It would be helpful if you would list those "4 messages" (or their classes).   Firm/I have some experience w/a similar library - but it aims (exclusively) at another's ARM MCU.

    Your written English is quite good - far beyond my German...     (German assumed, via "und" Parity and Stop)

  • Thanks for your answer!
    Yeah, I'm german :D

    So, my board is not compatible with freemodbus and I have to modify it...that's part of the problem I guess.
    My task is to cummunicate with a frequency converter. I have to write/read the rotational speed, read the current and an other signal. That's why I said four messages.
  • Ok - you are "younger & faster" than am I!      Now we don't (yet) really KNOW if your FreeModBus  "IS" or "IS NOT" compatible w/your TM4C123.

    Data & Instructions (must) have arrived w/your "FreeModBus" - is that not so.     And - does your read of that data make any mention of, "Those MCUs (directly) supported?"     We are hoping to find one - which DOES include the TM4C123.

    If it becomes clear that your current "FreeModBus" does not "play well" w/TM4C - we have choices:

    • launch a search for (another) version of   "FreeModBus"  - this one supported
    • read/review the "closest match" we can find - and then "Write those functions you require."
    • and another - are you "Forced" to stick w/that "frequency converter" - which (it is assumed) "locks you into ModBus?"    

    Your "need for ModBus" has not been explained - I have (some) slight competence - and am fairly certain that my small group can assist your, "Rotational Speed & Current/Other Signal Requirements" - best achieved "Free from (even) FreeModBus!"     Does this make sense?

    It is assumed this is a school project - might you consult (ask) the instructor if you can: a) Change to another ModBus App, or b) Eliminate ModBus altogether?

    I served two years in the US Army - working @ the Czech-German border - charged w/Developing and then Deploying Radar Systems - aimed at (other's) aircraft - dancing (near daily) across the border...    Good times...    And there were NO/ZERO speed limits on the Autobahn - at that time...

  • Tamara Ritz said:
    So, my board is not compatible with freemodbus and I have to modify it

    If the library is well written then porting is usually a matter of few functions that need written. In that case you may have good examples to start from. For Modbus RTU that would include the UART functions, something to control transmission direction and some timing.

    If the library is not well written you may be in for a world of hurt.

    Having said that, are you stuck on using RTU? If you can use Modbus ASCII you avoid all of Modbus RTU's timing issues. It's a lot simpler to write and debug, I've even done so with an interpreted language.

    Tamara Ritz said:
    My task is to cummunicate with a frequency converter. I have to write/read the rotational speed, read the current and an other signal. That's why I said four messages.

    That is actually probably 2 messages with different values. A write register message and a read register message. The only difference (as far as protocol is concerned) between speed and current is the register location.

    Robert

  •  Yes, I'm stuck to that frequency converter, I'm stuck to Modbus and I'm stuck to RTU. It could have been so easy for me, if I could have used CAN bus for everything, but well...

    These are the different FreeModbus versions. I would choose one randomly, but if you know which would fit the best tell me.

    I found a thread where someone tried this before and postet the parts he changed. I will orientate on that and try by myself.

  • Might you explain, "Why you are so Stuck?"     Cannot you present your "results achieved thus far" - and request an "escape" from your present, "Stuck position?"  

    It is suspected that the "real" (hidden) issue is the unfortunate acquisition of the, "so limited interface - frequency converter!"     If true - that's most unfortunate - is it not?   (and very telling)    

    How do you, your firm (or school) compete - when constrained to such an, "unforgiving/extra-effort/inefficient" development path?    (that's not too harsh - is it?)

    Some "desire for efficiency" should exist - be it a firm or university!     I would (at least) provide a "Review of your findings thus far" - and plead for, "Relief from the "locked in" prescribed path.

    Even if "not fully successful" - you have presented helpful facts - which support your (surely necessary) requirement for "more time" - to meet so "strict" (and inefficient) a demand...