View previous topic :: View next topic |
Author |
Message |
TheRidDler Guest
|
Highs & Lows on 18F252 |
Posted: Wed Jun 13, 2007 5:22 pm |
|
|
Hi there. This is my first post and also first time using PICs, let alone programming them. I have a problem however. I started out by testing
output_high & output_low statements on all the pins. I come across
three pins however that have a high state of Vcc, but a low of Vcc-0.8V.
The pins are C0, C1 and B2. Is there code to of statements that will force
the PIC to drive them to 0V? Thnx alot for your help in advance! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jun 13, 2007 6:16 pm |
|
|
Post your test program that demonstrates this. (Show all #include,
#fuses, and #use statements).
Post a description of the external circuits that are connected to those pins. |
|
|
Guest
|
|
Posted: Wed Jun 13, 2007 6:20 pm |
|
|
Test Program:
Code: |
#include <18F252.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
void main()
{
output_low(PIN_C0);
output_low(PIN_C1);
output_low(PIN_B2);
}
|
Circuits:
Code: |
C0 is connected to a PNP transistor that switches a RF module.
C1 is connected to a PNP transistor that switches a RF module.
B2 is connected to a PNP transistor that switches a GPS module.
| [/code] |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Guest
|
|
Posted: Wed Jun 13, 2007 7:01 pm |
|
|
Thanks alot for the link, i needed a couple of resistors to pull them down. Got that fixed now! The following thing im struggling with is setting up 2 software UARTS on my PIC. I've heard of and understand the basics behind it, but could someone mayb help me with a basic setup for a software UART in CCS 4.03? Im sure i can figure it out from a basic example. Im using a 18F252 PIC to receive data on pin A4 from a GPS, then send it via RF (rf tx pin is A0). On the receiving end i have a nRF905 Tranceiver module that handles the interface. Thnx alot! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|