Author Topic: Microcontrollers for beginners  (Read 7118 times)

0 Members and 1 Guest are viewing this topic.

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14297
  • Country: fr
Re: Microcontrollers for beginners
« Reply #25 on: April 16, 2021, 05:27:03 pm »
Maybe, but it would be interesting to see the rationale for that rather than keying headers by omitting male pins and using blocking inserts in the female side, all on a 0.1" pitch.   However I suspect that the history of that decision is either long lost, or at best vaguely remembered with no paper-trail . . .

You seem to be blowing this out of proportion. Keying headers mean additional cost, even if it's not much, and protecting boards meant for beginners was probably considered more important than allowing more advanced people to design their own "hats" with proto boards.

You seem to be missing the point of the Arduino boards. They are not primarily meant for people able to fully wire a custom PCB, even if just on a proto board, or even solder anything for that matter. Most users are probably just using them with Dupont wires and ready-made additional breakout boards and otherwise ready-made "hats".

Again, more advanced users still willing to use the Arduino ecosystem - which I'm not sure is a good idea, but to each their own - can use a myriad of alternative Arduino-compatible boards with much more powerful MCUs than the original ones on the Uno form factor, and usually with perfectly standard 2.54mm pins (on all those "feather"-like boards.)
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Microcontrollers for beginners
« Reply #26 on: April 16, 2021, 05:27:32 pm »
How else should i start then? i need your opinion

Do you have the hardware knowledge and the coding skills to write at the bare metal level?  If so, rock on!  If you stay with the Atmel ATmega style devices, you will use C and avr-libc.

http://www.nongnu.org/avr-libc/user-manual/modules.html

You should Google around for projects using the ATmega328 and avr-libc.  Duplicate them...

Arduino is denigrated because it makes things easy for beginners.  Usually by experts who have been coding hardware for decades.  And who says the code is bloated?  Have you done a project where you have run out of room?  Sure, it's possible, but unlikely for newcomers.  Unless they try to solve world hunger on a uC using Deep Learning.

The issue with Arduino is simple:  Can it solve the problem at hand easier than any other solution?  Very likely!  Everything that can be done with an Arduino has been done and the project is out on the Internet.  Are they going to qualify for the Nobel Prize?  Probably not.

The other day I was looking at the reference manual for some device (I have forgotten which).  It was over 4,000 pages and there will be a test later.  Sometimes quick and simple is the way to get things done.  No, I wouldn't be expected to know all 4,000 pages but I would need to know some significant percentage just to get started.  Things like turning on the power to peripheral devices and setting up clocks is a true learning experience, fraught with frustration.

Starting with a new platform, it might as well be ARM.  All the big kids are using them and there are many choices.  There is even a platform that serves a large number of boards and it's called mbed.  Now is the time for all the online toolchain haters to come out... 

You don't actually have to use the online toolchain, you can download the libraries and use a local toolchain.  And, it's true that you won't have a debugger but after 50+ years of single stepping code, I think that is the least effective way to debug known to man.  Printf() is a far better solution and it is portable across a lot of platforms.

One cool thing about online toolchains is that you only need a browser to program the device no matter where you are.  Cloud computing I suppose.

https://os.mbed.com/

Look in the hardware tab for a variety of boards that support the mbed way of doing things.  Here's a nice little Arduino shield compatible board with a CPU having 2MB of flash and 1MB of RAM (but read the fine print, only 864 kB of RAM is user RAM...  Based on the dual row edge connectors, it doesn't seem this board is particularly breadboard friendly.

https://os.mbed.com/platforms/ST-Nucleo-H743ZI2/

Do not expect the simplicity and handholding of Arduino when you move to these other platforms.  Sample projects just might not be as readily available.  There are MANY other boards that support the 'mbed' concept.  Pick something and start coding.

I like the LPC1768 incantation because it IS breadboard friendly.  It doesn't have as much IO but all I need to add for TCP/IP connectivity is a MagJack.  See my daughter card, attached.  All I have to do is include the TCP/IP library in my project and it's off to the races.

ARM is the present RISC-V is coming on strong and may play a big role in the future.  The one thing we can be sure of is that things will change.
« Last Edit: April 16, 2021, 05:56:19 pm by rstofer »
 
The following users thanked this post: M.Zohaib Usman

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Microcontrollers for beginners
« Reply #27 on: April 16, 2021, 05:51:38 pm »
Industry is not going to use the Arduino.  They might use the ATmega family of chips (hence avr-libc and gcc) but probably not.

Today everything is about ARM.  The older ARM-7TDMI chips were fairly easy to learn but they are pretty much obsolete.  The PSOC6 I referenced above has an ARM M0 and M4 core.  The videos show how to set up everything from the Cypress toolchain.  Cypress has some very good videos.

If you learn how to work with an ARM M4, for example, you will be pretty close to knowing how to work with all the ARM based chips with the exception of the included peripherals.  They will change between manufacturers/devices.

Get an ARM <anything> and study hard.  Sleep with the Reference Manual under your pillow.  It may not help but it probably won't hurt.  At some level of engineering, you will need to know everything in that manual.

Maybe ST tutorials can help:
https://www.st.com/content/st_com/en/support/learning/stm32-education.html

There are sample projects at the mbed.org site as well.  Google has a TON of information.

The ARM 7TDMI is a dead issue but here is a site that demonstrates ALL of the peripherals for the LPC2148

http://www.jcwren.com/arm/

Here's the Reference Manual (actually, it's just a web page, there is a link to download the manual)

https://developer.arm.com/documentation/ddi0210/c/

It's only 268 pages, perhaps that's why I liked the chip.

How to start?  Start with ARM <anything> and the chip vendor's toolchain.  Yes, this will result in bloat but it's a place to start.

 
The following users thanked this post: M.Zohaib Usman

Offline woofy

  • Frequent Contributor
  • **
  • Posts: 321
  • Country: gb
    • Woofys Place
Re: Microcontrollers for beginners
« Reply #28 on: April 16, 2021, 07:26:01 pm »
Im actually still a student and am trying to get into professional electronics field, not just a hobbyist
Don't choose a microcontroller because you think that's the one that will impress an interviewer, and don't abandon the AVR chips because you think they are hobbyist devices.
Choose a chip because that's the one you want to play with at the time, and try others as often as you like.
Knowledge of X architecture may be icing on the cake but on its own will not get you a job. I'll tell you what will get you a job. Ability and enthusiasm.
So pursue your hobbies. Ones that electronics and microcontrollers can help with.  That may be music, robotics, metal detecting, home automation, anything really. Build gadgets and devices for fun and to be useful to you.

It doesn't matter if you learnt processor X and the prospective employer uses processor Y.  When you go to interviews, speak with enthusiasm what you've done. I promise you that is what will impress the interviewer.
And one more thing, 12 years ago I did employ someone who was using an arduino for midi control. I saw the opportunity to expand our abilities and he is still with us.
 
The following users thanked this post: M.Zohaib Usman

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: Microcontrollers for beginners
« Reply #29 on: April 17, 2021, 02:02:13 am »
Maybe, but it would be interesting to see the rationale for that rather than keying headers by omitting male pins and using blocking inserts in the female side, all on a 0.1" pitch.   However I suspect that the history of that decision is either long lost, or at best vaguely remembered with no paper-trail . . .

You seem to be blowing this out of proportion. Keying headers mean additional cost, even if it's not much, and protecting boards meant for beginners was probably considered more important than allowing more advanced people to design their own "hats" with proto boards.

You seem to be missing the point of the Arduino boards. They are not primarily meant for people able to fully wire a custom PCB, even if just on a proto board, or even solder anything for that matter. Most users are probably just using them with Dupont wires and ready-made additional breakout boards and otherwise ready-made "hats".

Again, more advanced users still willing to use the Arduino ecosystem - which I'm not sure is a good idea, but to each their own - can use a myriad of alternative Arduino-compatible boards with much more powerful MCUs than the original ones on the Uno form factor, and usually with perfectly standard 2.54mm pins (on all those "feather"-like boards.)

On the other hand Ian.M kept his criticism of the Arduino strictly to the hardware, and his opinion is as valid as yours or mine.

Personally I find attempts to ascribe far reaching engineering foresight to a product that is clearly a WOFTAM to be quite funny.

Even after all my negative Blue Pill rants I think it has more reason to exist than the 'Arduino ecosystem'  but then that's only my own opinion.


 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5835
  • Country: es
Re: Microcontrollers for beginners
« Reply #30 on: April 17, 2021, 03:56:46 am »
I keep saying the PIC16 are only 35 intructions, easy to learn if you want to.
Plus very simple hardware, few registers to touch for making everything work.
Also, you have the xc8 compiler, it's very much the same as the old Hi-Tech (Microchip bought it), works very nice.
People always complain that C is not good on these, but I've seen the generated assembly and it was pretty nice.

Not everything is perfect though, I remember programming a PIC24 with Microchip's C30 compiler (Now called XC16).
I had to multiply and divide in a fast interrupt, and the datasheet stated that it had a fast hardware divider and a single cycle multiplier.
Well, that didn't work. I was losing interrupts, causing overlapping, overflows... when I debugged it, I noticed it was using 450 clocks only in the divide operation.
After a lot of fiddling around, I saw that in the assembly there were no instructions for the divider! It jumped to a classic divider loop.
At least the C compiler manual was good and well explained, I quickly found the built-in wrappers to call the low level hardware within the C code.
And it went down to 22 clocks!

Althought in free mode there are no optimizations. The last version that I know was it could be made "free" was the 1.41.
Plus the good thing is that as you learn, you can go for faster and enhaced families pic18, pic24... it's not like night and day, you get used to them pretty fast.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3998
  • Country: nz
Re: Microcontrollers for beginners
« Reply #31 on: April 17, 2021, 05:28:39 am »
I keep saying the PIC16 are only 35 intructions, easy to learn if you want to.
Plus very simple hardware, few registers to touch for making everything work.
Also, you have the xc8 compiler, it's very much the same as the old Hi-Tech (Microchip bought it), works very nice.
People always complain that C is not good on these, but I've seen the generated assembly and it was pretty nice.

Hey, maybe you could do me a favour?

I've got a silly little benchmark that I've run on a ton of different CPUs, ranging from 8 bit AVR, though all kinds of ARM stuff, to i7 and Threadripper and Zen and Xeon.

Mostly I've run the tests myself on things I've had access to but around a year ago eevblog members submitted a number of other results on things I don't have, such as esp32, esp8266, BluePill, BlackPill, and a chpKIT Pro with PIC32.

So I've got PIC32 in there, but no traditional 8 bit PIC.

Do you think you could compile and run my benchmark on a 8 bit PIC? That would be cool.

The code size is very small -- the actual benchmark part ranges from 178 bytes to 348 bytes on different CPUs with most around 200 to 250 bytes. Plus you ideally need some way to do printf() and calculate the number of clock cycles used, but failing that, toggling a GPIO pin and measuring the time externally would be fine too.

The RAM use is exactly 8000 bytes for two arrays (4000 bytes each) plus another 4 byte global and 12 bytes of local variables in the benchmark function and a similar amount in main, and whatever minimal stack you need -- so well under 8K (8192 bytes).

I'm not familiar with PIC and couldn't immediately find a PIC16 with 8K of RAM -- they seem to top out at 4K. However there are a ton of PIC18 with 8K for  under $3 in a 28 DIP package, so I assume you'd probably have one?

The clock speed is 64 MHz, so they look pretty speedy.

http://hoult.org/primes.txt
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 705
  • Country: ca
Re: Microcontrollers for beginners
« Reply #32 on: April 17, 2021, 05:49:17 am »
* The Arduino hardwere developers have had a history of making questionable design choices and mistakes.  The most widely known one is the 0.16" gap between the two digital headers on the Uno, which makes it excessively awkward to use 0.1" pitch protoboard for a shield, and has been inherited by every full sized successor Arduino.

Maybe it is a very clever solution to the problem of shields being plugged in backwards.  Sounds like good engineering to me!


Maybe, but it would be interesting to see the rationale for that rather than keying headers by omitting male pins and using blocking inserts in the female side, all on a 0.1" pitch.   However I suspect that the history of that decision is either long lost, or at best vaguely remembered with no paper-trail . . .


Nah, it was f*kup.   See response from Dec '09:  https://electronics.stackexchange.com/a/941 

"I got to meet Massimo at Flourish Conf in Chicago this year...
Turns out, the actual reason for the odd pin spacing was an error in the original CAD/gerber file. So yea, the odd pin spacing was completely unintentional. Massimo also mentioned that there was a proposal to remove the odd pin spacing starting with the Duemilanove, Mega and future models (a so called "restart"), but was voted down in favor of reverse compatibility with old shields, etc."




 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Microcontrollers for beginners
« Reply #33 on: April 17, 2021, 05:53:01 am »
On the other hand Ian.M kept his criticism of the Arduino strictly to the hardware, and his opinion is as valid as yours or mine.

Personally I find attempts to ascribe far reaching engineering foresight to a product that is clearly a WOFTAM to be quite funny.

Even after all my negative Blue Pill rants I think it has more reason to exist than the 'Arduino ecosystem'  but then that's only my own opinion.

You seem to have an extreme hatred for a platform that despite its warts, arguably almost single handedly saved the electronics hobby. There was a period I remember in the 90s and early 2000's where it was looking like the hobby was on life support. Heathkit had recently gone out of business, Eico, Knight, Dynaco and many others were long gone by then. Radio Shack had become cell phone and crappy RC toy shack, Active Electronics (now gone) was struggling to stay afloat, the well known surplus shops of the old days were dropping like flies, hamfests were drying up and going extinct, it was really bad. Microcontrollers existed, people were using PICs and AVRs but it was a niche thing, pretty much only people who were already engineers.

Then along came Arduino and it caught on like wildfire, the electronics hobby came roaring back, hacker and maker spaces began popping up, annual maker faires popped up, tens of thousands of new hobbyists got into electronics and started building all sorts of innovative stuff. Countless kids got started doing embedded programming at a young age and by now many of those have gone on to careers in engineering. I mean what's so wrong with all that? Frankly you sound a bit like one of those stereotypical old geezers who is angry that kids these days have it too easy and that back in the day you walked to school naked in a blizzard, uphill both ways and liked it just fine. To say the entire ecosystem has no reason to exist is just utter nonsense, the Arduino ecosystem is immensely popular, a smashing success by any measure that has allowed vast numbers of people to create things, some of them incredibly cool and creative, that a great many of them never would have been able to create without some sort of widespread and very easy to use platform. The software is free, the hardware is cheap as dirt and nearly as common. It's not aimed at professional engineers developing commercial projects but even so a lot of actual engineers will pull one out to whip up a quick proof of concept.

I really don't understand the thinking that leads one to believe that an extremely easy to use platform with dirt cheap widely available hardware, a very low barrier of entry and a tremendously huge library of existing projects, code and drivers for all manner of things is a bad thing. Doubly so when you can program it in C, the defacto standard language for embedded programming today, or even assembler if you really want to.
 
The following users thanked this post: retrolefty, brucehoult, WattsThat, pqass

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3998
  • Country: nz
Re: Microcontrollers for beginners
« Reply #34 on: April 17, 2021, 06:20:13 am »
Hear hear! Agree 100%.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3998
  • Country: nz
Re: Microcontrollers for beginners
« Reply #35 on: April 17, 2021, 06:37:11 am »
In the mid 2000s I'd been a professional programmer for 20+ years already, on everything from super minis down to my then current job writing a compiler and low level libraries (threading, exception handling, hash tables etc) for use in embedded systems. most of them using ARM7TDMI.

I wanted to get into doing my own embedded programming projects at home, but it seemed incredibly daunting to get started. One of the most popular things was called "BASIC Stamp" which just seemed like a preposterous idea. Was it possible to avoid BASIC and program the underlying PIC directly? I had no idea. It certainly didn't seem easy.

Everything else available seemed to be prototyping boards for professional engineers priced $500+ (if not $1000+), with as far as I could tell proprietary toolchains costing even more. And needing specialised debug and programming hardware.

And then three things happened within a maybe two year period, at most:

- Arduino (I think it was first)
- Mbed
- Beagleboard

Being able to use the standard GNU toolchain and power and program the board from USB was *huge*. And the prices very reasonable.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Microcontrollers for beginners
« Reply #36 on: April 17, 2021, 06:45:44 am »
Ah the BASIC Stamp, I never did have one of those but I remember thinking it was cool when I was a kid back in the early 90s or whenever that came out. It was expensive, seems like it cost around $50 which was quite a lot of money back then. Worse yet, over the 10 or 15 years they sold those things the price never dropped. I think it was the Arduino that finally killed off that overpriced and slow performing Stamp, which IIRC didn't have a compiler and ran interpreted code.
 

Offline Kerlin

  • Regular Contributor
  • *
  • Posts: 181
  • Country: au
Re: Microcontrollers for beginners
« Reply #37 on: April 17, 2021, 06:47:34 am »
Hear hear! Agree 100%.

Totally agree. Arduino is tops for beginners.
Many posters have already said you can program with the Arduino IDE in C which means you can do bit manipulation and Boolean operations to registers and therefore bare metal this includes ARM devices.
Despite this posters then come up and say you cant.
Common problem here is lack of reading comprehension - read it you are misleading others.
« Last Edit: April 17, 2021, 07:11:05 am by Kerlin »
Do you know what the thread is about and are Comprehending what has been said ?
 

Online Kleinstein

  • Super Contributor
  • ***
  • Posts: 14076
  • Country: de
Re: Microcontrollers for beginners
« Reply #38 on: April 17, 2021, 06:53:44 am »
For the start it help if the hardware part is reliable. So I would not recommend a blue pill for the start. As a beginner I would not want to chase HW bugs and incompatible versions. There are enough SW bugs to deal with.
So for the start a ready made board may be a good idea.
In this sense a Arduino hardware from a reliable source (no the cheapest clone from china) may not be so bad - however the software side is really trying to add too much abstaction. Depending on the knowledge this may be Ok but can also be more confusing than it helps.

The personal likes on the IDEs are different - it is not just the decission on a µC but also about the IDE and compiler. Initially one will learn more about the IDE than the µC.

When starting with assembler / bare metal, the AVR  is still a good starting point. The erratas are relatively short and the periphery is relatively simple.
The 8 bit PICs are quite confusing with page switching - nothing one really needs to learn and essentially all others avoid it.

When starting with C, the actual choice of µC is less important and one may as well start with some ARM board. One usually still has the question of bare metal register access and use of some hardware abstraction layer.
 At least with ARMs some abstraction is not so bad as the init part can be quite confusing and long. It is possible to combine it - use the HAL for initialization and direct register access later on - so it is no a strict black or white.
 

Offline pqass

  • Frequent Contributor
  • **
  • Posts: 705
  • Country: ca
Re: Microcontrollers for beginners
« Reply #39 on: April 17, 2021, 06:56:39 am »
...Active Electronics (now gone) was struggling to stay afloat, the well known surplus shops of the old days were dropping like flies, hamfests were drying up and going extinct, it was really bad. Microcontrollers existed, people were using PICs and AVRs but it was a niche thing, pretty much only people who were already engineers.  ...

Yeah, I bought a windowed PIC16C63 from Active in the early naughties. Raring to go but I had no help except the datasheet and not much else. The mood waned and it's been sitting in a box since. Ten years ago I discovered the UNO and have been using a mix of Arduino libraries + my own register fiddling code.  It's a good way to get familar with the chip; get it running fast then exploring each peripheral at your own pace. But especially helpful are the various tutorals on SPI, PWM, steppers, displays, etc.

After the UNO, it didn't take me long to buy blank '328s from Digikey, flash Optiboot using the UNO as a programmer, make my own MAX232-TTL converter and I've since been embedding a '328+3caps+1res+1xtal in a dozen projects.  Boy do I wish I had the whole ecosystem when I started with RadioShack, Forrest Mims and 555s in the '80s.
 

Offline Kerlin

  • Regular Contributor
  • *
  • Posts: 181
  • Country: au
Re: Microcontrollers for beginners
« Reply #40 on: April 17, 2021, 06:59:49 am »
You dont have to use the Arduino software abstactions.
The Arduino IDE can be used in pure C++ or C or even assembler.
Hello, hello, YET again - many have already said this.
You can use them to a get start but only if you want.
« Last Edit: April 17, 2021, 07:08:07 am by Kerlin »
Do you know what the thread is about and are Comprehending what has been said ?
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3998
  • Country: nz
Re: Microcontrollers for beginners
« Reply #41 on: April 17, 2021, 07:05:48 am »
Exactly. Interpreted BASIC. On a microcontroller with basically no RAM. For $50.

If you could stretch to around $100 (by 2008 or so, before Arduino, Mbed, Beagleboard came out) then you could get a WRT54G WiFi/Ethernet router and reflash it and run actual Linux on the MIPS CPU inside. By that time they'd already replaced the original model (from 2003 or 2004 or so?) with a lower cost one, but the hobbyist movement using them was already so large that they retained a hackable version under the model name WRT54GL (for Linux).

If I recall, they have a 200 MHz MIPS CPU, 16 MB RAM, 4 MB flash, and I think 16 GPIO pins of which a handful were not used for something already.

You can still buy them brand new today for $39.99

https://www.amazon.com/Linksys-WRT54GL-Wireless-G-Broadband-Router/dp/B000BTL0OA
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5835
  • Country: es
Re: Microcontrollers for beginners
« Reply #42 on: April 17, 2021, 01:23:24 pm »
Hah I'll check what I have lying around. It's been years since last time.
I doubt I have any 8 bit Pic with more than 1kb RAM... I do have some pic32 around, but that's a different story.
« Last Edit: April 17, 2021, 02:45:52 pm by DavidAlfa »
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline Jan Audio

  • Frequent Contributor
  • **
  • Posts: 820
  • Country: nl
Re: Microcontrollers for beginners
« Reply #43 on: April 17, 2021, 01:56:29 pm »
If you start with 8bit  PIC many things in the manual and online are for ASM programming, just ignore.
On microchip forum you can get good help.

Arduino has Atmega inside if i am right.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 3998
  • Country: nz
Re: Microcontrollers for beginners
« Reply #44 on: April 17, 2021, 02:33:06 pm »
Hah I'll check what I have lying around. It's been years since last time.
I doubt I have any 8 bit Pic with more than 1kb RAM... I do hace some pic32 around, but that's a different story.

Maybe I'll just have to buy one. I can afford $3 :-)

Seems it's easy enough to set up one of those wonderful flexible Arduinos to program a DIP PIC18F on a breadboard -- only needs some jumpers and 4 non-critical value resistors.

https://www.instructables.com/how-to-program-a-PIC-18F2550-or-18f4550-with-Ardui/
 

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 5835
  • Country: es
Re: Microcontrollers for beginners
« Reply #45 on: April 17, 2021, 02:46:54 pm »
I recommend not going that way. It will be painful.
Get a pickit and feel the power of debugging your code.
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 

Offline snarkysparky

  • Frequent Contributor
  • **
  • Posts: 414
  • Country: us
Re: Microcontrollers for beginners
« Reply #46 on: April 17, 2021, 02:50:43 pm »
start with pic24 series.  No bank switching like 8 bit pics and they are powerful chips.

You can get the free MikroC compiler in demo mode.  Only need to buy a pickit programmer.
 

Offline Jan Audio

  • Frequent Contributor
  • **
  • Posts: 820
  • Country: nl
Re: Microcontrollers for beginners
« Reply #47 on: April 17, 2021, 04:00:22 pm »
That bank-switching is exactly what i mean you can ignore if you program C language.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: Microcontrollers for beginners
« Reply #48 on: April 17, 2021, 04:20:32 pm »
Also, why would you use MikroC which notoriously lacks MPLAB X integration and all its libraries are closed source, when you could be using the appropriate Microchip  XC compiler for your chosen device in in Free mode, with full integration with the Microchip MPLAB X IDE, and source availability for all peripheral libraries, and for all except XC8 the C standard libraries?   Look at the respective limitations and licence restrictions of MikroC's demo mode and XC8/16/32's Free modes, and the choice is a no-brainer in favor of XC even if you discount the MPLAB integration issue and lack of library source access.
« Last Edit: April 17, 2021, 04:23:27 pm by Ian.M »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Microcontrollers for beginners
« Reply #49 on: April 17, 2021, 05:15:27 pm »
That bank-switching is exactly what i mean you can ignore if you program C language.

But it consumes a lot of flash and, of course, takes time to execute.  You can't avoid it, it's part of the architecture but at least in assembly language you can limit the impact.

It's worth the time to just look at the emitted assembly code.
 
The following users thanked this post: Ian.M


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf