News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Should I be here?

Started by ShawnR, December 05, 2011, 02:32:16 AM

Previous topic - Next topic

ShawnR

Hi All
This looks like a good forum but I am wondering if it may be a little early for me to walk here....

I am trying to learn PIC microcontrollers. In working through various "how to get started" articles, one mentioned that it would be best to start with lo level chips and doing so using Assembler before trying to learn C and higher level (mid range) chips. Other references I have found all refer to C and suggest jumping in at various levels of "Getting started".
I like the idea of starting with the "lo level" chipset so found an article from someone who was learning assembler and documented the process. He suggested MASM. In going to the intro page for MASM, it sounds like you need to be an accomplished programmer to start with assember so.....? Also, the warnings alone on the download page make me wonder if I am up to the task and if my computer is ready for it....I have not downloaded MASM yet, due to what I read.

I have done some BASIC stuff and programmed the Basic Stamp through some small projects. I am an old electronics technician who has only dabbled in electronics for the last 20 years.

Can anyone with a familiarity with my situation (perhaps someone has gone down this road?) point me in the right direction?

Should I luck into someone who can really relate, I am using a PICKit 2, although I suspect that is irrelevant here. I guess I might be looking for a good Assembler tutorial or perhaps not using the low level chips and just learning C..?

What do you suggest?

Thanks

Shawn

dedndave

welcome to the forum   :U

well - you may enjoy programming for windows with MASM   :P
but, i would say it is more complex than programming PIC's

for starters, the x86 instruction set is well advanced of any PIC
although, you don't have to learn the entire set to write code
in some ways, that may shield you from learning certain algorithms
for example, the pentium has multiply and divide instructions
for many PIC's, you would have to write those functions as routines

what makes ASM for windows complicated is the windows API
these are the functions offered by the operating system to provide programs an interface
this is where i spend most of my time trying to learn   :bg
it involves a lot of reading and tinkering

however, you can learn a lot about syntax, data, code, the process of assembly, and so on, that might be useful
it certainly can't hurt - but it may not be the fastest way to learn to write PIC code

if you want to get up to speed fast, they have little starter boards for a variety of PIC's
i have never messed with them - but i think they would be a good way to get going
the downside is - you have to spend some money to play - probably in the $50 to $100 range

as for PIC's with C or BASIC - nah - lol
ASM is the only way to fly

MichaelW

For learning to program PIC's and similar, I would think a good emulator running on a PC would be a better way to learn.
eschew obfuscation

clive

I have a PICKit 2 here somewhere on the bench. I'm pretty sure you can download a limited version IDE/Assembler/Compiler from Microchip. I'd check but the P4 system I had them installed on crashed a while back and haven't used them since. MichaelW's suggestion to get an emulator is probably the way to go, and many older processors have such emulators these days.

Lucio Di Jasio had some good books on the PIC families
https://www.google.com/search?tbm=bks&tbo=1&q=pic+microcontrollers&btnG=

As I recall the old PIC's are pretty limited, the new PIC32 parts use a MIPS M4K. The MIPS path does at least permit you to use open source tools like GCC/GAS, without spending stupid amounts of money on a proprietary architecture.

The old PIC's and frankly most of the old 8-bit processors aren't worth investing much time in, if I were to put a hat on and recommend a specific assembler to learn it would be ARM or MIPS. Once you're mastered the basic concepts of assembler, the skills are fairly portable. STMicro has some nice ARM Cortex-M3 parts, with experimental boards in the $10-20 range, and evaluation tools for free in the form of code limited IDE's from Keil or IAR.

Here the focus is x86, but clearly you aren't going to be able to build a simple system from scratch, and if the desire is to make simple processors work, and be able to actually build something it's probably not the way to go. You could use some old 16-bit 8086 (80186,V30 etc) chips, but you're probably 25 years late for that to be terribly useful in a forward look way. The application of x86 assembler these days is mostly math and algorithm heavy stuff.

I got here via BASIC, 6502, FORTH, Z80/8080, 68K, 8085, 8086/88, PASCAL, C, ARM, MIPS, and tinkered with many other microprocessors along the way.
It could be a random act of randomness. Those happen a lot as well.

vanjast

If you've played with PICasm you're halfway through Masm already..

Starting points are :-
- Study the processor technical hardware reference books.
You might find that starting with the I86(8086) book would be easier as it's simpler, and the same structures generally follow through to todays P6's

- Study the Application Reference Guide then the Sytem Reference guide.
I think this is what the books are called. All downloadable in PDF format from Intel.com

- Then after all that you have to get stuck into the Windows API (Application interface).
This is few volumes thick  :dazzled:, but don't dispair we all had to start there. The API is just a set of procedures/functions that Bill Gates has given us to use so that we can use the windows OS.

- Finally learning the MASM32 'IDE', which comes with a gazillion examples and tutorials.
Go through the examples and Tuts step by step... Once you get the hang of it, it's easy as pie

The problem with Masm is that MSoft only gives minimal support, which is a pity, coz if you compare this with MPLab for PICs, it shows how a great Masm IDE can be put together. but we can still build a 'fragmented' IDE with Masm with all the great packages 'lying around'  :green2

You'll spend many a night reading.. but that's cool




vanjast

Quote from: dedndave on December 05, 2011, 09:14:09 AM
as for PIC's with C or BASIC - nah - lol
ASM is the only way to fly
Having programmed embedded stuff in C and Asm, when I see a product working, I am about 95% sure what language was used in development.
Asm = low level, C and everything else = high level language

With Asm development one sees very few 'quirks', as asm developers generally know their hardware
:8)

ShawnR

Hey, thanks for all of the info. My goal is simply utilizing PIC's (and with their capabilities, not really taxing them either!) I guess what I was asking is, is it worth it to learn Asm just as a means to utilize lo level Pics ...as a means to learning PICs. But, I think, after reading the posts, probably not. It is one more thing (a really cool thing) to do but not necessary to meet my end goals. I do have MPLAB and have started with it. I have been able to open the supplied demo programs, load them into the programmer and get the "Lo pin count demo board" (supplied with the PICKit2) working as it is supposed to. Now I have to learn how to use MPLAB, and then learn the language, ie C or Asm. Maybe working with the mid range chips and C would be sufficient. I was thinking that to start with a smaller instruction set would be easy, albeit limited but it would involve a whole new sidetrack to learning. Ironically, the PIC is a sidetrack as I could do what I want to do with the BASIC Stamp and/or Atom but I thought that if I ever wanted to mass produce something, Stamps at $40 each is a little pricy. PIC's are cheap and really the brains behind the STAMP so I want to go to the source, so to speak. At the end of the day, it is all pretty amazing what these little packages can do. 

Thank you. I think you saved me some bruises from banging my head on the wall...... :clap:

Nice to see another great forum in place.

Maybe I will surface again one day if the PIC's take me down the ASM path but in the meantime, I won't take up your time with the myriad of questions I am sure to have.  :bg  I will go bug the posters in a PIC forum.  :bg

Thanks again. Cheers,
Shawn