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

Code Conversion

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







Code Conversion
PostPosted: Tue Feb 18, 2003 2:34 pm     Reply with quote

Hi,

I have a program which works brilliantly on a 16F84 but am having trouble converting it to a 16F873. On the 84 I use 0-3 on port A and 0-3 on port B for a keypad. The only difference that I can see between the 84 and the 873 is port A is a 6-bit wide port.

Can anyone suggest why I an getting no outputs on the ports on the 873?

Thanks
___________________________
This message was ported from CCS's old forum
Original Post ID: 11841
Eric Minbiole
Guest







Re: Code Conversion
PostPosted: Tue Feb 18, 2003 2:50 pm     Reply with quote

:=Can anyone suggest why I an getting no outputs on the ports on the 873?

Many of the pins on the 87x default to analog inputs on power up, so you have to manually set them to be digital I/O. Try adding:

SETUP_ADC_PORTS(NO_ANALOGS);
___________________________
This message was ported from CCS's old forum
Original Post ID: 11843
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: Code Conversion
PostPosted: Tue Feb 18, 2003 2:54 pm     Reply with quote

:=Hi,
:=
:=I have a program which works brilliantly on a 16F84 but am having trouble converting it to a 16F873. On the 84 I use 0-3 on port A and 0-3 on port B for a keypad. The only difference that I can see between the 84 and the 873 is port A is a 6-bit wide port.
:=
:=Can anyone suggest why I an getting no outputs on the ports on the 873?
-------------------------------------------------------

I don't think your schematic is correct. Here's a copy
of it, from your previous post.

In the 16F873 data sheet, it shows the pinout for Port A
is pins 2-7. You've got them as 13-18.

<PRE>
---------
+5--20-|Vdd |
+5---1-|Mclr |
Gnd---8-|Vss |
Gnd--19-|Vss |
4MHz--10-|Xtal |
4MHz---9-|Xtal |
| |
| 16F873 |
| |
| |
| |
| |
| |
| |
| |
| | ---------
| A0|-15--11-|D4 |
| A1|-16--12-|D5 |
| A2|-17--13-|D6 |
| A3|-18--14-|D7 |
| | | |-3--20K pot
| A4|-14---6-|EN |
| A5|-13---4-|RS |
| | | |
| | +5-2-| |
| | Gnd-1-| |
| | Gnd-5-| |
| | | DISPLAY |
--------- ---------

</PRE>

Also, you will need the pull-up resistor to +5v on RA4.
___________________________
This message was ported from CCS's old forum
Original Post ID: 11844
Eric Minbiole
Guest







Oops...
PostPosted: Tue Feb 18, 2003 3:38 pm     Reply with quote

Just found your previous post and that you already have the port configured as digital I/O.
___________________________
This message was ported from CCS's old forum
Original Post ID: 11849
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