View previous topic :: View next topic |
Author |
Message |
melissa creek Guest
|
Code Conversion |
Posted: Tue Feb 18, 2003 2:34 pm |
|
|
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 |
Posted: Tue Feb 18, 2003 2:50 pm |
|
|
:=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
|
Re: Code Conversion |
Posted: Tue Feb 18, 2003 2:54 pm |
|
|
:=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... |
Posted: Tue Feb 18, 2003 3:38 pm |
|
|
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 |
|
|
|