This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is it possible to program nRF52 DK with Python instead C language?

I wonder is it possible to program nRF52 DK with Python instead C language? And are there any examples with python?

Parents
  • Well..

    Yes, http://micropython.org/

    and No, there are a lot of developmental languages like this. They are fine to mess around with (if anyone has time for that!) but if you are asking about them that likely means you're looking for a way to avoid learning C. And with micro controllers, I have to tell you that's going to hurt you quickly. Once you understand memory, pointers are easy. Once you understand binary and bitmapping, special function registers are easy. Once you get how a micro works, you're going to want to work in C as something as high level as Python is going to abstract everything so much that you won't be able to determine what the code is actually doing.

    I like Python. I like microcontrollers. I'd never combine them.

    For what it's worth, I guess I do see a reason to use micropython if you have an enviroment where you are sending code to be executed to an existing micro. Like if you have a well coded enviroment in C, and you want to give that micro extra code to perform via an interface. Imagine you need local execution on a remote device. That would be a very small specific function inside a larger application. Doing the whole application in Py seems like a really bad idea for simple projects - not even getting into a Nordic SoftDevice BLE application.

Reply
  • Well..

    Yes, http://micropython.org/

    and No, there are a lot of developmental languages like this. They are fine to mess around with (if anyone has time for that!) but if you are asking about them that likely means you're looking for a way to avoid learning C. And with micro controllers, I have to tell you that's going to hurt you quickly. Once you understand memory, pointers are easy. Once you understand binary and bitmapping, special function registers are easy. Once you get how a micro works, you're going to want to work in C as something as high level as Python is going to abstract everything so much that you won't be able to determine what the code is actually doing.

    I like Python. I like microcontrollers. I'd never combine them.

    For what it's worth, I guess I do see a reason to use micropython if you have an enviroment where you are sending code to be executed to an existing micro. Like if you have a well coded enviroment in C, and you want to give that micro extra code to perform via an interface. Imagine you need local execution on a remote device. That would be a very small specific function inside a larger application. Doing the whole application in Py seems like a really bad idea for simple projects - not even getting into a Nordic SoftDevice BLE application.

Children
  • I share the view. Loving Python as high-level language on platforms which can handle it but you hardly write "quasi real-time OS" for single-threaded processors like ARM Cortex-M in it. There are people who use more advanced things (like Haskell;) for embedded development but always ends in C(/ASM) generation and then translation by GCC or similar compiler/linker to native binary code...

Related