Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16f and 18f

Status
Not open for further replies.
Hi,

Will it be good to start with PIC 18f series... as i got a good book on 18f series by Ramesh Gaonkar...

Regards,

Simran..:)
 
I don't think there's an official answer to that, but yeah it's a nice PIC family, tons of feature, a bit less of ready-to-go code example than PIC16 or PIC12, but not that hard to convert them.

If you plan to program in asm, you may find it a bit easier to use 18F.
 
I would choose an 18F over a 16F part any day of the week if the extra few pennies per component weren't an issue.
 
hi Simran,
BlueRoomElectronics , with input from other forum members, is preparing a tutorial book based on the 18F series of PIC's.

I would recommend that the 18F would be a good starting point for your PIC studies.:)

If you ask Bill, he may send you a Junebug pcb...
 
Last edited:
Well sir...

Well pic has always been my weakness ... I confess..

but i wanna learn it... a good tutorial is must as lots of features and very less material to start...

or say lot of material and more confusions..:eek:

even mplab is finding very difficult to work with...

i just wanna start anyhow...

Regards,

Simran..
 
I would suggest, as always, starting with the much simpler 16F series in assembler, and once you have a reasonable working knowledge, then move to the 18F series with C. The assembler and PIC knowledge learned from the 16F will greatly enhance your C abilities on the 18F.
 
Nigel Goodwin said:
I would suggest, as always, starting with the much simpler 16F series in assembler, and once you have a reasonable working knowledge, then move to the 18F series with C. The assembler and PIC knowledge learned from the 16F will greatly enhance your C abilities on the 18F.

I totally agree.
 
I find the 18F much easier to use for ASM as it doesn't have as many gotchas as the 16F series (i.e. page banking etc).

Thats just personal preference though - I find the 18F1220/1320 ideal as an entry microcontroller and it will happily run at 40mhz with a 10mhz oscillator.
 
I'll have to second the 18F as a starter, it's just so much nicer than the 16F.
Problem is it'll be hard to step down to the 16F series when you get used to the 18F
 
As time passes, many of these 16C/F series might get absolete and perhaps Simaran may not need to step down.

But Nigel's view appears more relevant, that assembly language will get one's foundation strong, where from one could grow stronger.
 
Well...

Hi,

It is good to understand that 18f holds the importance as one of the precious PIC controllers...

and other thing also that programming the controller directly in C without going for assembly is a wrong method...

Regards,

Simran..:)
 
simrantogether said:
Hi,

...
and other thing also that programming the controller directly in C without going for assembly is a wrong method...

Regards,

Simran..:)

Not so.

If the person already knows a high level language then starting in ASM is good.

If the person is new to programming then it is better to start with a high level language.

ASM is not a good first language. I will stick my neck out and say it is a bad first language.

It would be wrong never to teach/learn ASM.

It would be wrong never to learn C if you want a job as a firmware engineer.
 
Last edited:
3v0 said:
Not so.

If the person already knows a high level language then starting in ASM is good.

If the person is new to programming then it is better to start with a high level language.

ASM is not a good first language. I will stick my neck out and say it is a bad first language.

But C is also a bad first language, which is why Pascal was historically always the teaching language of choice.

It would be wrong never to teach/learn ASM.

It would be wrong never to learn C if you want a job as a firmware engineer.

The only problem with not learning assembler first is shown by all the masses of C questions being posted here these days - almost all of which are because the poster hasn't got a clue what a PIC is or what resources and limitations it has. A modicum of assembler knowledge would (and does) cure this, because it's impossible to use assembler without that knowledge.

It's like trying to learn to write a foreign language, without first knowing what the letters are! - think Arabic/Russian/Chinese, not French! :D
 
mvs sarma said:
As time passes, many of these 16C/F series might get absolete and perhaps Simaran may not need to step down.

But Nigel's view appears more relevant, that assembly language will get one's foundation strong, where from one could grow stronger.

The 18F instruction set is basically a superset of the the 16F instruction set, it adds several instructions such as
  • Compare and branch
  • 8x8 multiply
  • return with restore W, STATUS & BSR
  • LATx (does not suffer from Read Modify Write problem)
The syntax is the same for pretty much all the PICs.

Now the 12F has those nice small & cheap 8pin PICs.
 
Nigel Goodwin said:
But C is also a bad first language, which is why Pascal was historically always the teaching language of choice.



The only problem with not learning assembler first is shown by all the masses of C questions being posted here these days - almost all of which are because the poster hasn't got a clue what a PIC is or what resources and limitations it has. A modicum of assembler knowledge would (and does) cure this, because it's impossible to use assembler without that knowledge.

It's like trying to learn to write a foreign language, without first knowing what the letters are! - think Arabic/Russian/Chinese, not French! :D

And the number of Pascal posts is?

Mike.
 
Pommie said:
And the number of Pascal posts is?

Mike.
Yea, too bad I actually like Pascal and can program in it. It's sort of like saying I like slide rules.

I do agree with Nigel too though, to be successful with PICs thinking like the PIC thinks will give you a huge edge when writing code in any language.
**broken link removed**
 
Last edited:
Pommie said:
And the number of Pascal posts is?

None, because Pascal is so easy and intuitive you don't need to ask anything! :p

There are a couple of PIC Pascal compilers, but it's certainly fairly obscure on PIC's.

Really though it's not a good idea to try and force PC compilers to fit micro-controller architecture - Pascal, BASIC, and C, bear little resemblance to what you use on a PIC. JAL was an attempt to make a language more suited to a PIC, based on parts of all three of those.
 
I am (try to be) language neutral. Today I find myself defending C. Which is odd in that it is not my language of choice. But it does make sense to use it on a uC.

As I have said in the past, the quality of the tutorial or instruction is more (much more) important then the language used. You can teach people structured programming in pic assembly, or write butt ugly code in the latest greatest language, that sort of thing.

Nigel Goodwin said:
But C is also a bad first language, which is why Pascal was historically always the teaching language of choice....

True, but by the same standards assembler is much worse then C.

In an ideal world poeple would not touch uC's till after they were fluent in a high level language. Understood how to write clean code, that sort of thing.

The world is not ideal.

The mass of C questions does not show that people should learn assembler first. There are many factor that make it a very poor indicator.

I was surprised to see the number of PIC Pascal compilers that I found on the web.

I like Pascal. But like forth it is not main stream.

Spend less time with "my language is better then yours" and more time on what quality code is.
 
Spend less time with "my language is better then yours" and more time on what quality code is.
I must agree, however, some languages are better for teaching programming than others are. I do not think C is a good language to learn programming of anything. I like C, it is powerful, however it is not strongly typed, and beginners often get in trouble with data types. PASCAL, and its later development, MODULA2, were designed as teaching languages, and are strongly typed. There is a clear distinction between a procedure and a function, which is not enforced in C.
Programming concepts are language independent - when to use a while loop, rather than a for, for example, is the same in assembler, BASIC, C or any other.

As far as assembly is concerned, I don't think it is a good vehicle for teaching programming, but it is the best choice for learning exactly how the hardware works.

I think the biggest truth, though is:
In an ideal world poeple would not touch uC's till after they were fluent in a high level language. Understood how to write clean code, that sort of thing.

The world is not ideal.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top