Is BitBanding supported in ML17

cancel
Showing results for 
Search instead for 
Did you mean: 

Is BitBanding supported in ML17

Jump to solution
161 Views
Senior Contributor I

Is BitBanding support in the KL17 family of micro's?

I don't see it in the documentation.

I thought it was core for all the Kinetis micro's.

Thanks.

Joe

Update:  I have since discovered it called BME for this family.

Can't find the file BME.h.

I found another post that gave a link to FRDM_KL25 but could not find the file within any of the downloads.

Is the file still available?

Thanks.

0 Kudos
1 Solution
NXP TechSupport
NXP TechSupport

Hi Joe,

I've attached the BME.h, and please refer to it for details.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
Senior Contributor I

Ping:

Thank you for the file.

Joe

0 Kudos
1 View
NXP TechSupport
NXP TechSupport

Hi Joe,

I've attached the BME.h, and please refer to it for details.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Contributor III

Thank you Jeremy/Kerry/Ping, I have also found this useful, many months later.

It seems to cover different IDEs - good.

With the default default IDE settings on my MCUXpresso 11.1.1 BME.h generates 21 trivial warnings to remind that it might not be able to inline the code in all circumstances. This does not matter, it works just fine as far as I can tell and the machine-code was smaller than non BME code. Thank you.

So, using your excellent code I modified it to simpler macros that worked specifically for my target FRDM-KL27 evaluation board, possibly at the cost of your portability.

Surprisingly the macros generated a smaller binary and still worked properly after extensive testing.

There are interesting operational details to note when using BME that require clarification. So they are documented in the header.

I have attached the header file in the hope that it will help anyone - even if only the comments on BME details are useful.

Bear in mind this code is targeted at the KL27z MCU so the comments suggest the macros should only be used for peripheral address space registers as advised in the MCU KL27z32/64 reference manual.  Other MCUs might allow use with RAM. I tried Using Upper and lower RAM anyway and found that for BME access to one area a hard fault exception was generated, and for the other area no hard fault. So do NOTuse it for RAM unless your MCU explicitly supports it and you are certain which part of RAM is being accessed.

There are no asserts in the macros.

Regards, Rob

0 Kudos