Experimentalist
Well-known member
Hi
My question really relates to efficient programming in the 32 bit environment with the Teensy 3.0 and its 32 bit ARM
Cortex-M4.
Some background to put my question in context. I am a self taught programmer and have written the majority of my code in various combinations of VB and C# for Windows PCs. I must admit to having given little thought to the inner workings of my programs and have only recently been reading up about what's on the stack and what's on the heap for example in the managed code world with oodles of resources available.
I have been programming in the embedded world for just about a year working with Teensy 2.0 and Teensy 2.0 ++ and have been on a steep learning curve. I have assumed that working with the 8 bit AVRs I should try to optimise my code around 8 bit variable types where possible, so using a byte instead of an integer for example.
So my question is if I am now porting my Teensy 2.0 and Teensy 2.0++ code to the Teensy 3.0 I presume I should now try to optimise for the 32 bit architecture? If I create an int on the Teensy 3.0 is it a 32 bit integer ? Can anyone offer guidance regarding best practices for coding when targetting the Teensy 3.0 ?
I am guessing that my previous code deliberately trying to use byte over int will now (if not always ?!?) result in a performance hit rather than gain ???
Thanks for any guidance you may have to offer
Ex.
My question really relates to efficient programming in the 32 bit environment with the Teensy 3.0 and its 32 bit ARM
Cortex-M4.
Some background to put my question in context. I am a self taught programmer and have written the majority of my code in various combinations of VB and C# for Windows PCs. I must admit to having given little thought to the inner workings of my programs and have only recently been reading up about what's on the stack and what's on the heap for example in the managed code world with oodles of resources available.
I have been programming in the embedded world for just about a year working with Teensy 2.0 and Teensy 2.0 ++ and have been on a steep learning curve. I have assumed that working with the 8 bit AVRs I should try to optimise my code around 8 bit variable types where possible, so using a byte instead of an integer for example.
So my question is if I am now porting my Teensy 2.0 and Teensy 2.0++ code to the Teensy 3.0 I presume I should now try to optimise for the 32 bit architecture? If I create an int on the Teensy 3.0 is it a 32 bit integer ? Can anyone offer guidance regarding best practices for coding when targetting the Teensy 3.0 ?
I am guessing that my previous code deliberately trying to use byte over int will now (if not always ?!?) result in a performance hit rather than gain ???
Thanks for any guidance you may have to offer
Ex.
Last edited: