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.

API vs Register based programming



Should I use Stellaris API or Register based programming, for example, to work with UART. I found - using APIs to program simplifies the work, but poor documentation for the API makes it difficult to understand in register level and its interconnection with others and use it.

I like to know when do people use register programming and  the disadvantage of API programming.

NOTE: The controller am working on is Stellaris LM4F2532H5QD; Hope the discussion must be similar with the LM3S microcontroller.

  • Hi,

       Use the Stellaris API. Faster programming.

    -kel

  • Hi, can i know the disadvantage of API programming?

    Also I like to know when do people use register programming.

  • The Stellaris API has been used by thousands - thus has long been proven.  And - it often achieves multiple Register set-ups/configs - via a single API function.  Neither holds true for Direct Register - thus you, "cull yourself from the herd" - unwise on the Serengeti - perhaps this sometimes hostile plain as well...

    In addition - many (most) of the API functions include, "built-in" bounds testing - and will "squawk" when you enter an incorrect parameter.  Direct Register usually provides no such, "safety check."

    There are occasions where you must use Direct Register - due to the API not covering each/every Register, "nook/cranny."  (vastly expanded PWM capability - in M4 devices - is one example, the "unlocking" of certain critical MCU pins - another)  And - when used correctly - under certain conditions - Direct Register may reduce code size and speed execution...

    Be aware that ARM MCUs - from any maker - are highly complex - and considerable understanding, mastery and proper exploitation of Direct Register will enforce substantial investigatory time/effort upon such users. 

    Employers usually expect/enjoy "quick" results - far more likely from those using the rich, robust Stellaris API.  (and hopefully from the rebrand version - which vendor saw fit to modify - and evidences some misfire at this point in time...)

    Your green "tick/verify" may reward this in depth, considered, week-end response...