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.

pic selection help

Status
Not open for further replies.

normad

Member
hey guys,

this is going to be my first pic project and i need help selecting the right PIC. i need atleast 11 output pins and 4 input pins and i need for it to be programmable using c. i already downloaded mplab and it seems only the 18f series can be programmed using c language. i looked around a few catalogues and all the 18fs that i found comes with heaps of memory and other stuff that i think i myt not need. i need the cheapest possible and one that can be programmed using a top2049 programmer(which available in my uni). All i know is what i can see in the catalogue. but i think you guys would know whats commonly used and what the best :) so please help.. thankyou..

my program only needs to be able to measure the time a certain input signal lasts do a few calculations on it(devision multiplication) and output to seven segment displays(im planning to use a 4511 interface)
 
A 16F88 fits your needs and can be programmed with HiTech or BoostC.

Mike.
 
the manual says it supports pic16f882 pic16f883 pic16f884 pic16f886 pic16f887 are these the ones you're talking about? and im an international student in malaysia.. the programmer is whats available in the uni.. isnt it possible to program these pics using mplab? are hightec and boostc free..? are they better than mplab?
 
The 16F883 will work as it is a 28 pin device so plenty of spare I/O. You might be able to use a 16F628A as this has 16 I/O pins.

Both HiTech and BoostC have free versions that can use up to 2k of programming space.

Mike.
 
thanks! :) 16F628A seems ideal for me.. i read at a few places that its always better to use assembly than c? is this true? my experience in assembly is limited to the mips architecture.. is microchip assembly a lot different from mips? if not i wouldnt mind programming in assembly..
 
thanks! :) 16F628A seems ideal for me.. i read at a few places that its always better to use assembly than c? is this true? my experience in assembly is limited to the mips architecture.. is microchip assembly a lot different from mips? if not i wouldnt mind programming in assembly..

I would suggest you have a least a short 'play' with assembler, then use C afterwards if you want - because assembler forces you to understand the hardware, C trys not to - which makes it very difficult to understand whats going on. To write efficient C you really do need to have a minimum hardware and assembler knowledge.

EDIT: If you're heading towards C, then look at the 18F series, which are C optimised, and that there's a free compiler for. Many of the 18F application notes are in C as well, whereas the 16F ones are mostly assembler.
 
Last edited:
I must agree with Nigel, ASM is a must. At least learn how everything works this way you can always get around... You will also be able to easily select a PIC to work with once you understand it more.

As a beginner i would choose 2 PICs to play with ... 1x16F and 1x18F.. My choices would be:

16F628A - Most Common PIC now....
18F2550 - Beautiful 18F, has tons of memory and good I/O count. Also has USB for future use if needed. If not you could always use the pins as I/O...

The thing you have to remember is ... BUY SOMETHING with tons of memory and I/O... you could always downgrade final PIC to your specs...

A Perfect 18F pic is the PIC18F4620.... This has it all in my opinion... (NO USB tho) Tons of memory... Tons of I/O... When you finish the debug process you can easily find out how much memory your final program needs and find a PIC based on that.
 
I think there are really 2 topics here.

1. Is ASM and/or C a good first language.
A first language should hide the processor from the programmer. That will allow him to focus on the code rather then the processor instruction set.

A first language is best not learned on a uC.
2. Is ASM better then C on uC's.
I do not care. Use what turns your crank. I think all embedded programs should know their processor but why force them to use ASM. Few companies use ASM.
 
I think there are really 2 topics here.

1. Is ASM and/or C a good first language.
A first language should hide the processor from the programmer. That will allow him to focus on the code rather then the processor instruction set.

OK on a PC, but not on a microcontroller - you need to know the processor hardware, what it can do, and how you manipulate it - all the information that tells you this is usually in assembler.

A PC is no problem, the hardware is completely hidden behind the BIOS, so you need to understand the BIOS rather than the hardware.
 
What code can you write in ASM that you can not do in C ?

It's not a question of what code you can or can't write - although short or accurate delays are obvious ones, or anything that's particularly time sensitive.

It's a question of knowing what to write - datasheets and application notes are almost entirely in assembler, and you have to try and convert that assembler in to C to use it, with no idea what you're really doing. Assembler forces you to understand the hardware, which then allows you to effectively use C (or any other language).
 
For short delays embedded asm works fine. That is easy enough to do in C.

Everything is a trade off. I would that all embedded types know enough ASM to read the datasheets. Heck I wish more people could just read and understand datasheets!

We all come at this from our own perspective.
 
Last edited:
wow.. thats a lot of replies :) i feel all of you.. i wanna learn asm too.. and learn the actual hardware.. but given my deadline and my not so profound practice in asm i think i will do this project in c. because im quite accustomed the language and i have a small idea of how the hardware works thanks to mips. (i looked it up and PICS are not much different from MIPS except pipelining) the core concepts of any architecture are basically the same ryt.. after getting this assignment done i shall dedicate myself into mastering asm :)
that said.. can someone point me in the direction of figuring out how to measure the actual time a certain signal has been on in seconds.. the clock interrupt works in so high frequencies ryt.. im not clear on how to relate that to actual seconds :S
and is hitech c different from boost c? and where can i find the header file for my pic?
 
can someone point me in the direction of figuring out how to measure the actual time a certain signal has been on in seconds.. the clock interrupt works in so high frequencies ryt.. im not clear on how to relate that to actual seconds :S
It depends how accurately you want to measure it. If you need the time in mS then you can setup timer2 to give a 1mS interrupt and then an integer can measure up to 65 seconds. For uS accuracy you need to do a bit more work.
and is hitech c different from boost c? and where can i find the header file for my pic?
They are similar. Both have a free version that comes with all the required header files, look in the include directory.

Mike.
 
oh thanks! and no i dont need uS accuracy :) is there any tutorial which shows you how to set up the timer? i know im a pain in the ass but im new to this and i still couldnt find any proper hitech-c tutorial :S
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top