Microcontroller C programming

Discussion in 'Embedded Systems and Microcontrollers' started by MarcusK, Apr 30, 2012.

  1. MarcusK

    Thread Starter New Member

    Apr 30, 2012

    first of all excuse me for my bad english :)

    I have to program a microcontroller (STM32) with the programming language C.
    I know the basics of C but I don't know how to accomplish this project, because I don't have any experiences with microcontroller programming. So I really hope that someone can help me :)

    The protocol I have to use is Modbus RTU. The STM 32 is connected via serial port (UART) to an embedded SPS controller.
    My task is 1.) to read the values in the registers of the SPS and 2.) to set values in the registers of the SPS. That two tasks should be achieved over the STM32. I have also a list with the registers (data frames) I can address. The operating system that runs on the STM32 is Nut/OS and is given.
    The serial port is already initialized and works.

    Hopefully someone can help me!?
    Maybe there is someone who already made something similar to this. Or maybe someone who can help me to write the code.

    I really need help!

    Much Thanks in advance!


  2. kubeek


    Sep 20, 2005
    So basicaly you just need to send some string over the uart and receive another from the SPS? Did you try to find documentation of the uart functions?
  3. kingArgon


    Mar 20, 2011
    I program the st32 Cortex m3 and m4 and ill be the first to tell you its not recommended for the beginner. I would start with a PIC 16f628a and work my way up from there.

    but to a tutorial on the USART, download the cortex m3 peripheral library and look at the
    .chm file. there are examples on how to use the the USARTS. Good luck and happy hacking!
  4. hgmjr

    Retired Moderator

    Jan 28, 2005
    I agree with kingArgon. ARM processors are so complex compared to PIC and AVR micrcontrollers that a beginner will be overwhelmed by the datasheet.

  5. tallgirl

    New Member

    Jun 17, 2012
    It's for this reason that G-d created high-level programming language in graphical IDEs.

    I use AVRs for my products, and my "day job" uses ARM processors. High level languages are used on both.