View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
selection working mode on pin |
Posted: Sun Mar 27, 2005 7:03 am |
|
|
How to use just one option of one pin?
e.g.
RB0 / INT
I want to use / define just RB0.... |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Sun Mar 27, 2005 8:21 am |
|
|
Hello,
If you read carefully the datasheet, (Microchip PIC16F87x Datasheet, Page 7)
you will notice that most PINS share multiple functions wich are inherent
to the internal functional modules inside the PIC core.
In this case, RB0/INT means that the portB PIN RB0 can be used as
EXTERNAL INTERRUPT PIN. To activate this functionality you must enable
the corresponding interrupt bit INTE(INTCON.4) (0x0B) (see Page 16)
Using the CCS Compiler this is done with the built in function
enable_interrupts(INT_EXT)
You know that this forum it's not a PIC school, the best way to start
learning is using and preferably reading a book
http://www.piclist.com/techref/microchip/books.htm
Best wishes,
Humberto |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sun Mar 27, 2005 8:23 am |
|
|
Access it via a stuct
or define it as a #bit
take a look at the input(), output_high(), output_low() functions |
|
|
|