Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Problem in PORTE register of PIC

Status
Not open for further replies.

Hesam Kamalan

New Member
Hi,
I have a problem with PORTE of PIC16F877A. In MPLAB i write following code:
ORG 0X00
BANK1
MOVLW 0X00
MOVWF TRISE
BANK0
MAIN:
MOVLW 0X07
MOVWF PORTE
MOVLW 0X00
MOVWF PORTE

GOTO MAIN

END

After simulation, PORTE register have not affect and it is 0 for all times. But if I change E (PORTE) with B (PORTB), simulation becomes correct. For macro of banks, I write this code:
BANK0 MACRO
BCF STATUS, RP0 ; Select memory bank 0
ENDM

BANK1 MACRO
BSF STATUS, RP0 ; Select memory bank 1
ENDM

If you find my problem, tell me please.
 
Have you disabled the default analog function on those pins (RE0/AN5, RE1/AN6, and RE2/AN7) in ADCON1 SFR?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top