Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PORTC problem PIC16F876A

Status
Not open for further replies.

bimalkamal

Member level 1
Joined
Nov 27, 2011
Messages
32
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,529
I am using the following function to multiplex two Common Anode Seven Segment displays connected to pic16F876A. Code is working fine when cathods(dp, a,b,....g) are connected to PB0...PB7 and (each) common anodes are connected to the collectors of two PNP transistors which are switched on by writing 0 to RA0 and RA1. In this way everything is working fine.
But, Now I want to use portA to connect a sensor. So I have connected the bases of those two transistors to RC2 & RC3 and simply replaced every occurances of PORTA and TRISA with PORTC and TRISC. Now two transistors are not switching. No display. Help!


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#define FND1_ON 0xFE
#define FND2_ON 0xFD
 
#define FND_1_Direction TRISA0          //changed to #define FND_1_Direction TRISC2
#define FND_2_Direction TRISA1         //                #define FND_2_Direction TRISC3
............................
.............................
 
void fnd_display(int val,int pos){
 
      switch(pos){
 
      case 0:
      PORTA=FND1_ON;                  // Changed to PORTC=FND1_ON;
      PORTB=lup[val];
      break;
      case 1:
      PORTA= FND2_ON;                // changed to PORTC= FND2_ON;
      PORTB=lup[val];
      break;
         }
return ;
}

 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top