CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Highs & Lows on 18F252

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
TheRidDler
Guest







Highs & Lows on 18F252
PostPosted: Wed Jun 13, 2007 5:22 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 13, 2007 6:16 pm     Reply with quote

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








PostPosted: Wed Jun 13, 2007 6:20 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 13, 2007 6:35 pm     Reply with quote

Describe the connections to the transistors in more detail.
What pin on the transistor is connected to the PIC pin ?
Do you have a series resistor ?

See this tutorial.
http://www.winpicprog.co.uk/pic_tutorial_extras.htm
Guest








PostPosted: Wed Jun 13, 2007 7:01 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 13, 2007 7:39 pm     Reply with quote

Use the CCS search page to search for:
Quote:
software UART GPS

Set it to search for all words.

Examples of some of the hits:
http://www.ccsinfo.com/forum/viewtopic.php?t=30575&highlight=software+uart+gps
http://www.ccsinfo.com/forum/viewtopic.php?t=27682&highlight=software+uart+gps
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group