This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

what type of data should I choose?

Hello

I have a program written in assembler for 8051, I need to change it to a program in C for STM32F103. The old program has symbols for individual bytes in memory. e.g

in NFL byte:
SAVED EQU 18H; SAVED = 1 when state was saved
PRG EQU 19H; PRG = 1 when PROGR = 1
BWK EQU 1AH; BWK = 1 when FM = 1
PLUS EQU 1BH; button was '+' pressed
MINUS EQU 1CH; button was '-' pressed
FMERR EQU 1DH; FMERR = 1 when the FM memory is not resp.
Inoc EQU 1EH; Inoc = 1 the minimum brightness of the LED

Does the C language for STM32 also have an equivalent mechanism that allows access to individual memory bits in a similar way to 8051?

Parents
  • The whole point of the 'C' programming language is that it is not different for STM32 than for any other target.

    The way you allocate variables is not specific to the target.

    This is very basic 'C' stuff.

    I would recommend that you start by learning 'C' basics on a PC rather than on an embedded microcontroller.
    Once you have mastered the basics on a PC, then you can move on to the added complications for cross-development to an embedded target.

    Here are some 'C' learning & reference materials to get you started - including a free online textbook:

    blog.antronics.co.uk/.../

Reply
  • The whole point of the 'C' programming language is that it is not different for STM32 than for any other target.

    The way you allocate variables is not specific to the target.

    This is very basic 'C' stuff.

    I would recommend that you start by learning 'C' basics on a PC rather than on an embedded microcontroller.
    Once you have mastered the basics on a PC, then you can move on to the added complications for cross-development to an embedded target.

    Here are some 'C' learning & reference materials to get you started - including a free online textbook:

    blog.antronics.co.uk/.../

Children
No data