Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

General about a microcontroller

Status
Not open for further replies.

stoui333

Junior Member level 2
Joined
Feb 6, 2009
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,469
Hi all i just need to clarify some things regrading microcontrollers.

To create a really simple project to turn on and off a lamp or whatever, you need a PIC,right?

Then you need to hard wired your PIC and lamp according to the data sheet of the PIC ?

Finally to use a software to write the necessary assembly commands?

Now, what do i need to know regarding the PIC what specifications to have (ok someone might tell me according to your needs...but what are the most important to know?)

And, does the manufacture of the PIC provide a software to talk to the PIC?

All the PIC have pins to connect a battery?

PIC uses machine language correct?

Sorry for being so annoying...

Thanks in advance!

Regards Christos
 

To create a really simple project to turn on and off a lamp or whatever, you need a PIC,right?

NO NOT REALLY.It can be done without using microcontroller.

Then you need to hard wired your PIC and lamp according to the data sheet of the PIC ?

You need to connect the sensor circuit to the input of the pic and the leds or ... to the output port of the pic.

Finally to use a software to write the necessary assembly commands?
YES


Now, what do i need to know regarding the PIC what specifications to have (ok someone might tell me according to your needs...but what are the most important to know?)
here are some
number of inputs and outputs
input is analog or digital
memory needed
application is the one which specifies that
to start with pic16f84 is good


And, does the manufacture of the PIC provide a software to talk to the PIC?
There are lots of stuff on the internet

All the PIC have pins to connect a battery?
You need to supply something to turn the pic on!


PIC uses machine language correct?
you can use assembly yo write or pic basic
 

to program your PIC microcontroller you will need certain software and hardware:
- you can program your pic in other languages beside assembly like C, BASIC and even in pascal.
-you can use MikroC or MikroBASIC or MikroPASCAL, free demo version is available online.
-you can you use MPLAB IDE and its assembler, or you can use C compilers incorporate with it like C18 and C32 (each is used with a certain type of PIC), MPLAB, C18, C32 academic versions are free from Microchip official website.
-you will need programmer circuit to program the PIC, you can use something like PICkit 2, PICkit 3, ICD 2....etc

good luck
 

Thanks for the info!!

So i`ll start with a simple project.

I`ll buy the pic16f84 and i`ll use the MPLAB to write the assembly commands!

But how i`m i going to download the code on the pic? What else is required? How i`m i going to connect the pic with the pc?

Regards Christos
 

as i mentioned above, you will need a "programmer", this is a device used to download your .hex file (output file of the MPLAB assembler) on the microcontroller.
the most famous programmers/debuggers for PIC microcontrollers are PICkit 2, PICkit 3, ICD 2.
 

Hi !
My advise :D


First you need to decide which language to use for programming. Choices are: C language and assembly language.

Assambly is easy to turn leds on and off. Later you will feel the need for the speed so you may find it useful but atm. it is just too much work (10x or more) for example to get LCD displaying something simple text.


C language is higher level language. You you need only one line of code to turn leds on: "output_high(PIN_C1); "

Also LCD and other peripherals are much easy to use. For example to display a changing variable on LCD you do not need use 100 lines of assembly commands . Just change pin names in LCD header file and use "printf("varaible: %u", varaible_a); "

Btw to use higher level language you need some basic knowledge about it. Download a ebook or view some examples on youtube. ;)

To get a program on chip you will need programmer. A pickit 2 or 3 (cheap and good). Or if you want to learn and test yourself you can use emulation software Proteus. (no need to but real "peripheral interface controller micro controller module")

You may also want nice dev. board for testing to get feedback (right and wrong working good bad ? ? ? ). Believe me that a nice dev board will speed up your designs very very much. For exampe dev board with LCD, some button and potentiometer. Also you may need it to show your progress to other people to get 1UPs. Proteus is not so effective.


My suggestion is first start with PROTEUS DEMO and CCS compiler DEMO.


I wish you all the best and i hope you will achieve what you want.
 

Ok for a long time i wanted to learn c... is it free to download?

Also what is the difference between C and C++?

For most PIC C language is used right?

Lets say that i bought pickit 2... with that i can download the code on it and transfer it to the PIC right? How its done? i need somewhere to plug the pickit 2 what is that?


Thanks for your advices...
 

Well :D
You absolutely wanted right thing. C is base for almost all programming languages. If your good in C your performance is better in advanced programming languages. Well... If you know assembly programming techniques ... it is 1UP also.


So far as i know there is no good C++ compiler for PIC so your choices are C and Basic. i advise C.


C is learned from books and eBooks mostly, also in schools. Learning is knowledge of language structure (syntax, builup) and techniques. But the ultimate target is experience and your performance.


Start with motivation ;)

Search from ebook online ... or tutorial videos (maybe better to learn but book is for remembering, looking for stuff that if familiar from videos).


And defiantly start with CCS compiler demo. Because if you want something you can find easier what you are looking for because of good support and


Remember you do not need much c knowledge to start with PIC c programming. very basic things... declaring data types and program flow(loops). Also you may find very useful to fully understand examples.
 

Hey Jokker thanks for your suggestions and advices! :D

I`ll definitely start searching for C books even though i now the basic commands.

I need to clarify some things please...

I now know that i need to write my C program for the PIC. Then i need to use a compiler to be able to transform my code in machine language. Then i`ll need something to transfer my code and download it to the PIC (does pickit 2 needed for this task? ), Then i need to do the hard wired between the PIC, the LED and battery).

On my dev. board i need a component to be able to connect the ""
something to download the code on the PIC? What`s that component?
The PIC data sheet contains info on how to connect that something to be able to be used?

Sorry for these questions but i can`t get the general idea how the procedure goes and how to download the code on the PIC!

I`ll start reading C now :D to be able to proceed later on!

Thanks a lot for being so patient :!:
 

stoui333 said:
Ok for a long time i wanted to learn c... is it free to download?

1-Also what is the difference between C and C++?

2-For most PIC C language is used right?

3-Lets say that i bought pickit 2... with that i can download the code on it and transfer it to the PIC right? How its done? i need somewhere to plug the pickit 2 what is that?


Thanks for your advices...

1- C++ is an object oriented language while C is not. In embedded software development mostly the language of choice is C. Therefore you don't need to worry about C++ atm.

2- Not only for PICs, but for most of the microcontrollers. Actually you can use C do develop code for almost *anything* today.

3- pickit2 is an in circuit programmer/debugger. It communicates with the PC via the USB port. There are special pins in every PIC which are used for in circuit programming/debugging. You need to connect the programming signals of the pickit2 to these pins. But this is only the case for pickit2. Some programmers have a socket on them on which you place the PIC that needs to be programmed. After programming, you remove your PIC from the socket and put it back in your circuit. Programmers with in circuit programming capability removes the need of doing this.

Devices like pickit2 come with a software to be used for programming. Some of them get integrated with some IDE's (like MPLAB) so you can program your device just by choosing the appropriate command from the menu of your IDE. (After you've made the physical connections between the PIC, programmer and the PC of course)

PS: Don't forget that PIC is not the only microcontroller family you can use. But it's the simplest and therefore most widely used one for beginners.
 

That`s clear now thanks!

In the case that i`m going to use a PICkit 2 it means that i won`t write my program on C but i have to use MPLAB IDE software to be able to transfer my code?

But I want to use C language ! In this case what i need to buy to get started....
 

Using MPLAB is only one option. You don't have to use MPLAB and assembly language. You can use other IDE's for developing your code in C and then compiling it. For example HI-TECH PICC and CCSC. PICkit2 supports more than one IDE. See the link below.

**broken link removed**
 


stoui333 said:
Hi all i just need to clarify some things regrading microcontrollers.

To create a really simple project to turn on and off a lamp or whatever, you need a PIC,right?

You can use a 8051 too!

Then you need to hard wired your PIC and lamp according to the data sheet of the PIC ?

What would the lamp be? An LED or a 10W bulb?

Finally to use a software to write the necessary assembly commands?

Assembly or C is the question?

Now, what do i need to know regarding the PIC what specifications to have (ok someone might tell me according to your needs...but what are the most important to know?)

Nothing really, just ask for the lowest pin count.

And, does the manufacture of the PIC provide a software to talk to the PIC?

Yiu can use a variety of demo softwares free.

All the PIC have pins to connect a battery?

Two pins to the battery!

PIC uses machine language correct?

All micros use machine language, humans use assembly, who uses C :)?

Sorry for being so annoying...

Thanks in advance!

Regards Christos
 

Hey all thanks for your replies.

I would like some advices.

I decided to use C language. Now i need to find a C compiler. Is the final file in HEX or BINARY?

I`m having already the 16F84A-04 PIC. I found a programmer that supports 8, 18, 28 and 40 pin PIC microcontrollers which allow serial programming and I2C EEPROM memories.
It also comes with ICSP connector.

Is it possible to connect this programmer to my laptop?

Also i would have the chance to write a C program, use a compiler and download it to the PIC?

Thanks in advance!
 

Hi,
For C language for PIC16F84A, you can use:
1. CCS C Compiler
2. mikroC (my preference)
3. HI-TECH C
4. ByteCraft C Compiler
 

Tahmid said:
Hi,
For C language for PIC16F84A, you can use:
1. CCS C Compiler
2. mikroC (my preference)
3. HI-TECH C
4. ByteCraft C Compiler


Hey thanks for your reply!

I want to know these compilers are used just to convert the C language into machine language?

So i have to develop my C "set of commands" and then load that file into one compiler to convert, or i can direct right in these compilers the commands i want and convert them immediately ?

How do i know which C commands to use to lets say set pin 2 as input or whatever? There are different commands depending the compiler, the PIC ?

Until now i could write and debug a program using C, now that i need to interact with a microcontroller, i need to read about these commands right? :|
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top