VoltVolt
Junior Member level 1
- Joined
- Sep 15, 2013
- Messages
- 15
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 124
I'm using PIC18F45K22...
My PIC is just connected to ICSP Header from PICKIT2...
What I want is let all the PIC output pins to provide 5V(except MCLR and Vss).
This is my code:
Result:
Some giving 5V as I expected, but some didn't...
Below are those pins which unable to provide 5V output...
-RA0 1.3V
-RE0 1.3V
-RE1 0v
-RE2 0v
-RC0 1.3v
-RD0 1.3v
-RD1 1.3v
-RD2 1.3v
-RD3 1.3v
-RD4 1.3v
-RD5 1.3v
-RD6 1.3v
Thank you...
My PIC is just connected to ICSP Header from PICKIT2...
What I want is let all the PIC output pins to provide 5V(except MCLR and Vss).
This is my code:
Code:
#include <htc.h>
/* Start of configuration fuses*/
#pragma config IESO=OFF, FOSC=INTIO67,PRICLKEN=OFF,FCMEN =OFF,PLLCFG=ON,BOREN=ON,BORV=250
#pragma config WDTEN=OFF
#pragma config P2BMX=PORTC0,CCP2MX=PORTC1,PBADEN=OFF,CCP3MX=PORTE0,MCLRE=INTMCLR,HFOFST=OFF,T3CMX=PORTC0
#pragma config DEBUG=OFF,STVREN=ON,XINST=OFF,LVP=OFF
#pragma config CP0=OFF,CP1=OFF,CP2=OFF,CP3=OFF
#pragma config CPB=OFF,CPD=OFF
#pragma config WRT0=ON,WRT1=ON,WRT2=ON,WRT3=ON
#pragma config WRTB=ON,WRTC=ON,WRTD=ON
/* end of configuration fuses */
void main()
{
OSCCON=0b11110011;
OSCCON2=0b00000000;
ANSELA = 0x00; //Configure all ports as I/O digital
ANSELB = 0x00;
ANSELC = 0x00;
ANSELD = 0x00;
ANSELE = 0x00;
TRISA=TRISB=TRISC=TRISE=1; //set all ports as input
LATA = LATB = LATC = LATD = LATE = 0xFF;
}
Result:
Some giving 5V as I expected, but some didn't...
Below are those pins which unable to provide 5V output...
-RA0 1.3V
-RE0 1.3V
-RE1 0v
-RE2 0v
-RC0 1.3v
-RD0 1.3v
-RD1 1.3v
-RD2 1.3v
-RD3 1.3v
-RD4 1.3v
-RD5 1.3v
-RD6 1.3v
Thank you...