SIGforum.com    Main Page  Hop To Forum Categories  The Lounge    Learning to program microcontrollers
Go
New
Find
Notify
Tools
Reply
  
Learning to program microcontrollers Login/Join 
W07VH5
Picture of mark123
posted
I'm looking to learn to program microcontrollers. I've been messing with them and got some working circuits with a microcontroller firing a relay but the more I read, the more I find I'm going about things the wrong way. I haven't programmed in about 8 years so I'm rusty but C seems simple (i was a C# guy before).

I also want to incorporate Bluetooth and MIDI into my design.

I tend to learn better with books rather than online articles and real-world examples work best for me rather than abstract analogies. Foo(bar) examples don't work for me very well and I don't like "it's like a car and your driving it home" because it's nothing like me driving a car. Analogies make things harder to understand for me.

I'm working with Microchip PICs and MPLAB X IDE but I'm not married to either.

Any suggestions for me? Books? Better IDE? Better microcontroller brand?
 
Posts: 45331 | Location: Pennsyltucky | Registered: December 05, 2001Reply With QuoteReport This Post
Member
Picture of btgoanna
posted Hide Post
You may want to look at Arduino. They have some good stuff and a reasonable IDE.
There is a tinyduino that plugs into USB port on pc.



.
 
Posts: 832 | Location: Central Texas | Registered: November 19, 2006Reply With QuoteReport This Post
W07VH5
Picture of mark123
posted Hide Post
quote:
Originally posted by btgoanna:
You may want to look at Arduino. They have some good stuff and a reasonable IDE.
There is a tinyduino that plugs into USB port on pc.
I kind of have a thing against pre-built circuits and working from kits. I probably should pick one up though. They are popular for a reason, I'd imagine. I surely could learn to use the interrupts instead of a nest of IFs in the loop.

What did you mean by "reasonable"?

If I get something rolling on the arduino AT chip how will that translate if I want to go with the Microchip PIC.
 
Posts: 45331 | Location: Pennsyltucky | Registered: December 05, 2001Reply With QuoteReport This Post
Member
posted Hide Post
C is really simple, as long as you ALWAYS remember to de-allocate all allocations you make, you never try to access the -256 index of an array you created, you always remember to de-reference pointers, etc., etc., etc. C is a bitch if you're not really careful and you can really screw things up. C also lets your project morph easily due to to lack of objects and all of an objects goodness. Buffer overruns are easy as hell to create and they can be a major pain to find. Visual Studio community edition is free, really mature, and has c, c++ compilers if you choose to go with a language that is that low level. You can also write in assembler if you want to kick it down a notch lower.
 
Posts: 7524 | Registered: October 31, 2008Reply With QuoteReport This Post
Member
Picture of btgoanna
posted Hide Post
quote:
Originally posted by mark123:
quote:
Originally posted by btgoanna:
You may want to look at Arduino. They have some good stuff and a reasonable IDE.
There is a tinyduino that plugs into USB port on pc.
I kind of have a thing against pre-built circuits and working from kits. I probably should pick one up though. They are popular for a reason, I'd imagine. I surely could learn to use the interrupts instead of a nest of IFs in the loop.

What did you mean by "reasonable"?


Well it isn't in the same league as visual studio , but it is free , and functional



.
 
Posts: 832 | Location: Central Texas | Registered: November 19, 2006Reply With QuoteReport This Post
W07VH5
Picture of mark123
posted Hide Post
quote:
Originally posted by Bytes:
C is really simple, as long as you ALWAYS remember to de-allocate all allocations you make, you never try to access the -256 index of an array you created, you always remember to de-reference pointers, etc., etc., etc. C is a bitch if you're not really careful and you can really screw things up. C also lets your project morph easily due to to lack of objects and all of an objects goodness. Buffer overruns are easy as hell to create and they can be a major pain to find. Visual Studio community edition is free, really mature, and has c, c++ compilers if you choose to go with a language that is that low level. You can also write in assembler if you want to kick it down a notch lower.
I own an older licensed copy of Visual Studio. I imagine the newer versions would work a bit smoother but I'd have to check if there are any restrictions on the use of the free version. Thanks.
 
Posts: 45331 | Location: Pennsyltucky | Registered: December 05, 2001Reply With QuoteReport This Post
Member
Picture of vthoky
posted Hide Post
I'm trying like heck to learn Arduino, but C kicks my butt. Frown




God bless America.
 
Posts: 13427 | Location: The mountainous part of Hokie Nation! | Registered: July 15, 2007Reply With QuoteReport This Post
W07VH5
Picture of mark123
posted Hide Post
My programs are going to be extremely simple. Tripping a relay or sending a MIDI control change while muting audio output for a few microseconds.
 
Posts: 45331 | Location: Pennsyltucky | Registered: December 05, 2001Reply With QuoteReport This Post
W07VH5
Picture of mark123
posted Hide Post
quote:
Originally posted by vthoky:
I'm trying like heck to learn Arduino, but C kicks my butt. Frown
The thing I'm having issues with is accessing and using the different bits of architecture in the microcontrollers.
 
Posts: 45331 | Location: Pennsyltucky | Registered: December 05, 2001Reply With QuoteReport This Post
Member
posted Hide Post
There are options out there now other than C/C++ for microcontroller programming. One popular choice is Circuit Python. Not being a python guy myself, I have mostly stayed away from it but I have to admit that it does seem to make things really easy to learn.

As far as an IDE goes, the official Arduino IDE sucks. I use Visual Studio with the visual micro plugin (not free but there is a trial). You can also use visual studio code with the Arduino add on, or vs code with platform.io. There are a bunch of options to choose from.

I am working on a Bluetooth project at the moment and use the nrf52 development board from adafruit. I think there is circuit python support as well but cannot remember for certain. This gets you a pretty powerful microcontroller with integrated Bluetooth LE and has various avenues for MIDI control, including over BLE and serial.
 
Posts: 39 | Registered: January 19, 2013Reply With QuoteReport This Post
Member
posted Hide Post
quote:
Originally posted by mark123:
quote:
Originally posted by Bytes:
C is really simple, as long as you ALWAYS remember to de-allocate all allocations you make, you never try to access the -256 index of an array you created, you always remember to de-reference pointers, etc., etc., etc. C is a bitch if you're not really careful and you can really screw things up. C also lets your project morph easily due to to lack of objects and all of an objects goodness. Buffer overruns are easy as hell to create and they can be a major pain to find. Visual Studio community edition is free, really mature, and has c, c++ compilers if you choose to go with a language that is that low level. You can also write in assembler if you want to kick it down a notch lower.
I own an older licensed copy of Visual Studio. I imagine the newer versions would work a bit smoother but I'd have to check if there are any restrictions on the use of the free version. Thanks.


Free version has no restrictions, it just doesn't some of the features the "full blown" version has. I also have one more licence on an "Architect" version of Visual Studio 2013 that you are more than welcome to. I moved on from the 2013 version.
 
Posts: 7524 | Registered: October 31, 2008Reply With QuoteReport This Post
W07VH5
Picture of mark123
posted Hide Post
quote:
Originally posted by Bytes:
Free version has no restrictions, it just doesn't some of the features the "full blown" version has. I also have one more licence on an "Architect" version of Visual Studio 2013 that you are more than welcome to. I moved on from the 2013 version.

Thanks! Any idea about using Visual Studio with PicKit3? I got it off of Amazon but I think it's a Chinese knock-off. It will not work with my Mac but does work with any of the Windows machines in the house.
 
Posts: 45331 | Location: Pennsyltucky | Registered: December 05, 2001Reply With QuoteReport This Post
  Powered by Social Strata  
 

SIGforum.com    Main Page  Hop To Forum Categories  The Lounge    Learning to program microcontrollers

© SIGforum 2024