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 programming question

Status
Not open for further replies.

hussong1555

Member level 1
Member level 1
Joined
Jul 3, 2008
Messages
36
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,286
Location
USA
Activity points
1,503
I am working on a robot using a PIC16F84A. I need to send a pulse through an I/O port. is there a line command in Embedded C that i could do that or am i just better of doing this:

RA3=1
RA3=0

I also need to run a timer and wait for a response to a different I/O is there a straight forward command for that?

i sort of know how to do these in PBASIC, but i like the versatility of C and would rather code with that.
 

In terms of the C language, there is no such thing as embedded C.
It is just a term that means the program has been targetted for a stand alone module and not a PC.
You only get the standard libraries and the examples provided by the compiler vender. everything else you do yourself.
What you are doing is correct. Set the line High, and then low again.

The device you are using, PIC16F84A, is very old and long in the tooth. It was the first Pic with flash memory made by Microchip.
There are some more powerful and cheaper devices available.
You need a chip with a capture/compare module to capture and time your external signal.
 

hussong1555 said:
I am working on a robot using a PIC16F84A. I need to send a pulse through an I/O port. is there a line command in Embedded C that i could do that or am i just better of doing this:

RA3=1
RA3=0

I also need to run a timer and wait for a response to a different I/O is there a straight forward command for that?

i sort of know how to do these in PBASIC, but i like the versatility of C and would rather code with that.
For the pulse signal use a tempo function and use it like that
RA3=1
Call tempo
RA3=0

For the other question i think that you'd better use interrupts.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top