Electronics > Beginners
Program pic microcontrollers and coding language?
<< < (9/10) > >>
SteveThackery:

--- Quote from: brumbarchris on December 30, 2024, 09:36:31 am ---I started the same way: PIC first, then other (sometimes higher level) embedded platforms. And I am absolutely thankful it happend this way. I would have had serious difficulties to understand what's happening ''under the hood'' otherwise. Doing a limited amount of assembler and stepping through code, seeing the effect on individual registers at every instruction (and interrupt) was very... eye opening.

--- End quote ---

We can agree to differ on this. In my experience, working at the register level when you just want to multiply two numbers is a pretty steep learning curve. Higher level (than assembly) languages are the right place to learn about some of the universal concepts such as if/then, switch/case, functions, for, while, basic arithmetic, etc.

Once you've got your head around those concepts, then you can have a look at how they are implemented down at the register level.

Also, the great thing about Arduino is how readily you can get some successes under your belt. Your first flashing LED is a "Hah!" moment, and I think that most beginners would get a real kick from modifying 'Blinky' so it flashes "SOS" in Morse code, or whatever. That kind of kick really does motivate you to press on with the next learning challenge.

Anyway, I'll shut up now.  ;D. As I say, we can agree to differ.
mikeselectricstuff:
There is really no need to do assembler on PICs these days. The C compiler, even in free mode is good enough for the vast majority of cases.  The increased use of banking in larger PICs makes assembler more error-prone

PGPG:

--- Quote from: brumbarchris on December 30, 2024, 09:36:31 am ---
--- Quote ---I did it the other way round: PIC first, then Arduino. I wish I'd done Arduino first, but it didn’t exist back then.
--- End quote ---
I started the same way: PIC first, then other

--- End quote ---

Everyone starts as conditions allow.
I have never started with microcontroller programming. In our 2 person team it is my brother who writes microcontroller programs.
Our first microcontroller program should be bug-free from first shot as we had to pay (and it was expensive for us) for EPROM programming service to have it burn into EPROM and you couldn't check it in any way before paying for that service.
It's easy to guess what that program was doing.
No! Like probably no one else our first program was not LED blinking.
It was program for 8048 that was receiving data via RS232 (8048 had no UART so bit by bit byte sending and receiving and whole communication protocol was coded 'manually') and then programming them into EPROM (switching 25V VPP and so on). I have written the program working at IBM-XT to read HEX file and send it by RS232 to our device.

After getting our EPROM programmed first what we have done was to program new EPROM with the same program and check if it is working.
Even programming and verification passed successfully our EPROM didn't worked! :(
My brother made a mistake resulting in programming all 256 byte pages (except the first one that was programmed correctly) in random locations (verification was done at the same page address so passed).
To avoid paying next time for EPROM programming our next task was to shorten being longer than 2 pages program to fit into one page and be able to program at least 2 pages. Removing all communication error checking and EPROM program verifying we did it being one or two bytes shorter than 256.
Being able to program EPROMs ourselves was the first step to be able to use microcontrollers.

I think one explanation can be needed to people coming from 'normal' countries.
In Poland those time things like EPROM programmer (being imported) had 'normal' prices while everything else (salary and living) was may be 100 times cheaper (my academic teacher salary was about $13 per month). So if someone bought EPROM programmer for his may be 3 month salaries he offered EPROM programming for the price resulting from this.
brumbarchris:

--- Quote --- We can agree to differ on this
--- End quote ---
I agree.

Why I still look fondly to ''my'' approach is that I continued for a very long time to actually use microcontrollers for low level relates stuff. Only much later did I come across the need to actually multiply numbers or do more complex algorithms with micros and had the need to move to C. To each their own, I suppose.

What I fear is that if you start with such higher level things which shield you to a considerable extent from the register an single cycle stuff, you might not find it necessary to look under the hood until much, much later. And at that point one might find it a nuisance, rather than a natural step.

Regards,
Cristian
mkube396:
ok there is a lot of reading in here for me to look at here..

right now i might be a little in over my head with the "pic" stuff I guess ill try to focuses on "Arduino" I'm all ready semi familiar with the Arduino IDE
i did try  to understand how to wright code for a month. but i was lost and was not able to get anything i made to work.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod