Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

looking for a program c for pic

Status
Not open for further replies.

nitigon

Member level 1
Joined
Dec 19, 2002
Messages
36
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
125
hand compiling zx80

need program c for pic
 

emdee

Member level 2
Joined
Oct 5, 2002
Messages
50
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
294
C for Pic?

Why would you use c for pic? Pic language is very easy. It's compact and logic. If you use a language like C its like taking an airplane to visit your neighbours.

I myself had to yearn Pic and I got the hang of it within a day or two.
 

GrandAlf

Advanced Member level 2
Joined
Mar 9, 2002
Messages
520
Helped
47
Reputation
92
Reaction score
6
Trophy points
1,298
Location
UK
Activity points
4,730
CCS Compiler is good. Lots of functions with it.
 

sc/mp

Full Member level 2
Joined
Feb 10, 2002
Messages
128
Helped
7
Reputation
14
Reaction score
6
Trophy points
1,298
Activity points
1,054
Hitech good also !

The many fonctions of CCS are not very usefull if you must frequently, like me, jump from Pic to 51, AVR or HC908.

If you want to stick on Pic CCS is OK !

Quasi Ansi C (like Hitech, Keil, Icc, Codewarrior...) give good portability from
one chip to another.

Bye
 

newmania

Member level 1
Joined
Sep 29, 2002
Messages
37
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
228
If you want portable code use hitech picc. If you want functions to easily use, use picbasic!
 

owen

Junior Member level 1
Joined
Jun 6, 2002
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
69
I respectfully disagree with the claim that C is overkill for pic programming :) . For some applications such as motion control, writing the code in assembly is a plain pain. Just look at application note AN532 from Microchip titled "Servo control of DC Brush Motor", the code listing is over 100 pages long which I find to be quite difficult to debug and maintain. Many of you are no doubt very good at assembley, so I guess this is not really an issue that will bother you. However, for slackers like me writing code in C certainly save time and keeps my sanity :D .

By the way, I find that the HT-PICC compiler sometimes generates more efficient code (with optimization on of course) than what I can write :oops: .

owen
 

neriusb

Newbie level 6
Joined
Feb 4, 2002
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
29
By my opinion, if you are using 12bit PIC's (like popular 16C5X) you should use assembler, for 14bit and more - C is OK.

neriusb
 

thomaz

Member level 2
Joined
May 4, 2001
Messages
48
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
atlantis
Activity points
329
some words from a dinosaur :)
I wrote assembly code for 8080, Z80, 8051, HPC and PIC and I thought I did it well
nevertheless, 10 years ago I had a course in programming µC in C
there was alot of headache before the first program worked
but through the years I discovered the great benefits of C
today I write programs for PIC, 8051 and M16C in C (even PIC12C508)
if nessessary assembly code is included, but overall < 2%
at this point I could start a list of advantages and disadvantages, but believe me, C is great !
 

zorro

Advanced Member level 4
Joined
Sep 6, 2001
Messages
1,131
Helped
356
Reputation
710
Reaction score
298
Trophy points
1,363
Location
Argentina
Activity points
8,902
Use C and/or assembly for micros and DSPs

Hi friends,

I started programming micros directly in assembly where there were not compilers available. But later I started to use the following method, that reveled to be very efficient for me:

I start to code my program in C, compile it and perform tests. The result can be very slow and memory consuming, but this allows me to verfy the correctness of the algorithms an helps to identify the critical parts (those than are worth to be optimized). I can run and debug the program at reduced speed.
If necessary, I optimise those parts coding them in assembly (hand compiling). I preserve the original C code as comments. This step is frequently unavoidable in real-time applications.

As a result, the program is easy to mantain and modify. And is you want to migrate to another micro or DSP, you don’t have to start from zero.

Even in the case I don’t have a C compiler, I found very important to code it in C and compile at hand. Thinking the algorithms in high-level language is very helpful, and use state diagrams for finite-state machines (not flow diagrams).

I hope this point of view can help.

Z
 

ash

Full Member level 3
Joined
Dec 25, 2002
Messages
151
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Location
Europe
Activity points
1,051
neriusb said:
By my opinion, if you are using 12bit PIC's (like popular 16C5X) you should use assembler, for 14bit and more - C is OK.

neriusb
why we should use assembler for 12-bit PICs?
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top