Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

4th bit of PIC16F84 PORTA no working electrically

2 posters

Go down  Message [Page 1 of 1]

gtorreao



I'm using SimulIDE-0.4.15-SR10.appimage in ubuntu 18.
I have assembled the code bellow using gpasm 1.4.0.
Code:
      list      P=PIC16F84, R=D
      include   "p16f84.inc"

temp1      equ      0Ch
temp2      equ      0Dh
count      equ      0Eh

      org      0000h   
      goto      start

      org      0008h


start      bsf      STATUS,RP0

      movlw      b'00000'
      movwf      TRISA
      movlw      b'11111111'
      movwf      TRISB

      bcf      STATUS,RP0   


main      movf      PORTB   ,W
      movwf      PORTA   
      clrwdt
      goto   main

      end
The code was successfully assembled.
It's supposed to copy the content from inputs in pins B0 to B4 from PORTB and copy to outputs in pins A0 to A4 from PORTA.

The MCU Monitor shows that the code is executing okay.
The TRISA and TRISB is correctly configured (setting every pin in PORTA as output and every pin in PORTB as input).
The value recorded in register PORTB corresponds to the electrical levels driven to the pins and is correctly copied to PORTA.
Thus, I'm able to change the value of the A4 bit in PORTA register by changing B4.

Nevertheless, A4 electrical voltage keep stuck in 0V, no matter the value in the register PORTA.

arcachofo

arcachofo

Hi.

I think PORTA4 is open drain, so you need a pull up resistor.

gtorreao



arcachofo wrote:Hi.

I think PORTA4 is open drain, so you need a pull up resistor.

You're correct. It worked with a pull-up. So, it's not a bug.

arcachofo

arcachofo

Glad to know that you could solve it.

Anyway thanks for reporting.

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum