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.

pic microcontroller begins programming

Status
Not open for further replies.

embpic

Advanced Member level 3
Joined
May 29, 2013
Messages
742
Helped
80
Reputation
160
Reaction score
77
Trophy points
1,308
Location
india
Activity points
5,213
Hello masters
I am beggining to pic uc programming in c and i have experiance of working on emb c on 8051.
My ques. Are
Which compiler to be used for programming which will save memory and optimize code . And which compiler is best to use . I have ccs & hi-tech also.
I am using pic16f876a uc . And develop little dev. Board also.

How to configure porta as i/p and o/p and how to use for adc also.
 

Try MPLAb or mikroc.
The two are good for Pic programming.
 

MPLAB and MPLABX - IDE for programming all PICs, built in assembler and various 'C' compilers can be integrated as well. Free from Microchip and up to date. Linux and Windows versions.
MikroC - popular C compiler and debugger, not free and different versions have to be purchased for different PIC families.
CCS - same as MikroC
WizC - inexpensive C IDE compiler, assembler, debugger and one of the best simulators, covers most 12F, 16F and 18F PICs but at the moment poor support for new devices, not updated for 2 years.
SDCC - free but does not work on all PICs, also covers many other processors and is maintained and updated regularly. Linux and Windows versions.

There are numerous others but thise are probably the most popular currently available.

To configure the ports look at the TRIS instruction, there is a whole chapter on the ADC in the data sheet.

Brian.
 

How to configure porta as i/p and o/p and how to use for adc also.

Hi,

By default, PortA is initialised to Analogue Inputs.

For Digital use you must first set the ADCON1 register accordingly and then the TRISA register to specify if they are to be used as Digital Inputs or Outputs.
 

Hi,

By default, PortA is initialised to Analogue Inputs.

For Digital use you must first set the ADCON1 register accordingly and then the TRISA register to specify if they are to be used as Digital Inputs or Outputs.

How can the ADCON1 and the TRISA be specified for digital input if possible include a c statement to show example.

- - - Updated - - -

Hi,

By default, PortA is initialised to Analogue Inputs.

For Digital use you must first set the ADCON1 register accordingly and then the TRISA register to specify if they are to be used as Digital Inputs or Outputs.

Please how can the ADCON1 and TRISA registers be specified as digital input? If possible use a short c code to show example.
 

If you cannot work out which registers are for what purpose you will never sucessfully write a program!

Read the data sheet section 4.1 and the section on ADCON1 in the ADC chapter.

Brian.
 

k thanx brian
i am using mplab ide but which compiler is best either CCS / HI-TECH.
because ccs provide inbuilt function also.
 

I agree, XC8 has some "interesting" bugs but on the whole it is quite good and unless you delve deep into advanced programming you probably wont ever see them. The base version is also free so you don't have to invest a lot of money up front. If you like it, or need the optimization features you can upgrade without changing your code, just apply the license and recompile your exixting program.

Brian.
 

thanx all of u
now i am goig to start programmin
g with X8 compiler .
i have jdm programmer but it is serial.and i have pc do't have serial port. so, i want any diy usb programmer
which workable.
thanx .
 

or suggest me which to buy? because near market have different venders which local also thanx
 

There is USB to serial converter in the market, just go to any shop where computer and its accessories and buy it. Do not forget to buy the driver also.
 

means i requir extrernal power supply.i dont want any external power supply.
thnx..
 

yes i have blink all port with delay.
this was my first pic prog from me.
&
i need any usb based programmer if anyone know plz let me know and if it is DIY then it will be my favorite work.
 

Yes there are many USB based programmer available in the market you can go for PICKIT 2 programmer/debugger
 

Top3100 universal programmer is good as it supports pic microcontrollers. Try it...

- - - Updated - - -

Check TOP853.
 

yes i have blink all port with delay.
this was my first pic prog from me.
&
i need any usb based programmer if anyone know plz let me know and if it is DIY then it will be my favorite work.

You can Buy PICKIT2 or PICKIT3
there are many sample programs
**broken link removed**
try it on your own.
 

If you are new to PIC you must study the configuration bits and control registers which are different for PIC microcontrollers. can you share the program with which you have blinked the LEDs
 

Yes i have problem with _CONFIG() . so, i skip this part and flash all ports.
i use help from XC compiler but examples are not given there.
i dunno have any idea how to configure this with this method or any other method.
 

when i do programming wiyh mplab x then it compiled well but not working with mplab 8

- - - Updated - - -

it shows that cant open file xc.h even i have selected the compiler
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top