Microcontrollers and C programming advice

NorthGuy

Joined Jun 28, 2014
611
I have been led to believe that I do not need to teach myself assembly language as this will be taught to us at university, it's just programming microcontrollers using C that I need to be able to do.
Don't be afraid of learning too much. You cannot do it. Start with any language you want and with any MCU you want. At this point it makes absolutely no difference. Do a simple project. You will have to learn something. Once you're done, do the next project. You'll learn a little bit more. In doing it this way, you eventually realize that the language is the least important thing to worry about. The most important thing if you want to learn how to program - do not reuse other people's code, write your own.
 

MrChips

Joined Oct 2, 2009
34,828
Want to have some fun, learn programming and get a headstart?

My recommendation is get this for 8 quid:
http://uk.farnell.com/texas-instruments/msp-exp430g2/g2xx-launchpad-dev-kit/dp/1853793
http://uk.farnell.com/texas-instruments/msp-exp430g2/g2xx-launchpad-dev-kit/dp/1853793
http://uk.farnell.com/texas-instruments/msp-exp430g2/g2xx-launchpad-dev-kit/dp/1853793
Download the free IAR Embedded Workbench for MSP430. Register for the code limited version.

Follow my MSP430 blog and ask questions when necessary.

Program some flashing LEDs. Make a Christmas tree decoration just in time for the season.
 

dannyf

Joined Sep 13, 2015
2,197
I would not start with assembly , it is good for really simple things or really complex envelope pushing type of tasks.

You can simply think of a typical MCU as a core plus peripherals that you control by writing to or reading from special addresses in the memory space. The MCU doesn't Care how you flip those bits but only that they are flipped.

As to specific boards, the neocleo boards from st are really nice, especially with their arduino compatible headers. The to launchpads are good too but some of their chips can be buggy.
 

Thread Starter

Spark1985

Joined Dec 1, 2016
7
I just wanted to say you guys have been absolutely amazing, and your all getting me even more excited about programming and microcontrollers.
I can do a few simple binary operations like adding, subtracting, multiplying and dividing. I also understand truth tables and combinational logic, karnau maps and Boolean expressions. Converting to different gates etc. It all just makes sense.
What I do need to familiarise myself with more is computer systems etc...I have read a bit of the book that I got out so I could identify with the high level language etc that has been mentioned. I really just need to improve my understanding of the terminologies regarding that.
Thank you so much for explaining the differences between compilers and interpreters, as I was really struggling with what the difference was. I knew what machine code was, but struggled to understand the difference between what assembly code and high level languages were, so thank you so much for explaining that.
Also thank you for mentioning the different ways of of using a microcontroller to control something that requires a higher voltage/power level. I would say I will most definitely need some form of galvanic isolation, as when speaking to a lecturer earlier today he mentioned the fact that even magnetic inductance from a circuit can create 5V...therefore if not galvanically isolated there could be a high possibility of interfence with the control circuit. I should probably I am not particularly new to the electrical/electronics world and I do have experience working as an electrician so understand the operation of control circuits, switching and logic levels. However my electronic knowledge is not as good as it needs to be and my programming knowledge is almost non existent. However both of these really interest me. I have a project to do this year for my HND and as it will require a lot of time and effort anyway, I would like to use it as an opportunity to improve my knowledge and skills in the areas of electronics and programming... especially programming.
If I haven't mentioned your post specifically it isnt because I haven't appreciated or benefitted from the knowledge you have passed on. It's literally because there is so much to read and I'm quite busy right now. There has been at least one or two things in everyone's posts that has been of benefit. So thank you all so much for your time and effort.
 

Thread Starter

Spark1985

Joined Dec 1, 2016
7
Oooo...thank you Mr Chips I think I may just buy one of those. And your blog looks good as well.
I had been interested in the bbc micro bit and there was a really cool buggy kit you can get for it...I done a little research and found you can programme it in C and unlock more of the available functionality and get an effectively increased processing speed. However it seemed as though unlocking that possibility maybe a bit difficult. I was wondering if anyone has done it and what their view was, of this? Is it worth it?
It appealed to me because I have a son and thought it maybe a nice way to get him interested in programming in 2/3years time, as it can also work on much simpler code.
As always any and all thoughts and opinions are very much appreciated.
 

shteii01

Joined Feb 19, 2010
4,644
Oooo...thank you Mr Chips I think I may just buy one of those. And your blog looks good as well.
I had been interested in the bbc micro bit and there was a really cool buggy kit you can get for it...I done a little research and found you can programme it in C and unlock more of the available functionality and get an effectively increased processing speed. However it seemed as though unlocking that possibility maybe a bit difficult. I was wondering if anyone has done it and what their view was, of this? Is it worth it?
It appealed to me because I have a son and thought it maybe a nice way to get him interested in programming in 2/3years time, as it can also work on much simpler code.
As always any and all thoughts and opinions are very much appreciated.
bbc micro? Is that the one they gave to all the school kids in Britain?
I ask because I heard about it recently and in reference to another high level programming language (MicroPython http://theamphour.com/323-an-interview-with-tony-dicola/ )
 

Thread Starter

Spark1985

Joined Dec 1, 2016
7
bbc micro? Is that the one they gave to all the school kids in Britain?
I ask because I heard about it recently and in reference to another high level programming language (MicroPython http://theamphour.com/323-an-interview-with-tony-dicola/ )
It's quite likely, that it was...however it is no longer free.
It seems quite versatile which hll you can use with it, however I'm not sure the C compiler for it is free. To be honest I was wondering if anyone knew of a free C compiler that would work with a BBC microbit. I read all the features it has on board and to be honest it got me a little excited about the possibilities
I can totally see this ending up in an obsession, my brother has an arduino that he hasn't touched and I'm itching to get my hands on it...he lives in Denmark though.lol. He programmes for a job and is completely self taught no degree or anything...however at the end of a day programming he doesn't really feel like doing more.
 

shteii01

Joined Feb 19, 2010
4,644
This says that BBC micro:bit has Nordic nRF51822 uC: https://developer.mbed.org/platforms/Microbit/

Nordic provides Software Development Kit: http://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF5-SDK But you still need compiler. Probably best to use Keil MDK-Lite, it is free, but it limits you to 32 kB of code while uC has 256 kB of flash to store code. So. Install Keil MDK-Lite, then follow Nordic directions of installing SDK.

Another option for compiler is GCC. Nordic says their SDK will work with GCC.
 
Top