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

SimulIDE_1.0.0-RC3_Lin64 not reading inputs in PIC16F84

2 posters

Go down  Message [Page 1 of 1]

gtorreao



I'm using SimulIDE_1.0.0-RC3_Lin64 in linux 20.04 and compiled the code bellow in gpasm 1.4.0, and it should copy the content of PORTB to PORTA.

Code:
list p=PIC16F84, r=DEC
 include "p16f84.inc"
 org 0
 goto start
 org 8
start bsf STATUS, RP0
 movlw b'00000000'
 movwf TRISA
 movlw b'11111111'
 movwf TRISB
 movlw b'00000000'
 movwf INTCON
 bcf STATUS, RP0

inLoop movf PORTB, W
 movwf PORTA
 clrwdt
 goto inLoop
 

 end

I'm using fixed volt sources as inputs in PORTB and cannot cause any change in this port. I've checked MCU monitor and PORTB values is always 00000000.

I noticed that when putting the component of PIC16F84 in the schematic the messages
"Warning: Register not found: "PINA"

Warning: Register not found: "PINB" "
appeared in the terminal.

arcachofo

arcachofo

Hi gtorreao, thanks for reporting.
I noticed that when putting the component of PIC16F84 in the schematic the messages
"Warning: Register not found: "PINA"

Warning: Register not found: "PINB" "
appeared in the terminal.
Yes, there is an error in one of the configuration files.
It is solved at Rev 1138, but you can fix it yourself:

Edit file: SimulIDE_1.0.0-RC3/data/PIC/p16F8x/p16F84_perif.xml
Remove "inreg="PINA" and inreg="PINB"

From this:
Code:
  <port name="PORTA" pins="5" outreg="PORTA" inreg="PINA" dirreg="!TRISA"
                   opencol="00010000">
  </port>

  <port name="PORTB" pins="8" outreg="PORTB" inreg="PINB" dirreg="!TRISB"
                     pullups="!RBPU" >
To this:
Code:
  <port name="PORTA" pins="5" outreg="PORTA" dirreg="!TRISA"
                   opencol="00010000">
  </port>

  <port name="PORTB" pins="8" outreg="PORTB" dirreg="!TRISB"
                     pullups="!RBPU" >

gtorreao likes this post

gtorreao



arcachofo wrote:

From this:
Code:
  <port name="PORTA" pins="5" outreg="PORTA" inreg="PINA" dirreg="!TRISA"
                   opencol="00010000">
  </port>

  <port name="PORTB" pins="8" outreg="PORTB" inreg="PINB" dirreg="!TRISB"
                     pullups="!RBPU" >
To this:
Code:
  <port name="PORTA" pins="5" outreg="PORTA" dirreg="!TRISA"
                   opencol="00010000">
  </port>

  <port name="PORTB" pins="8" outreg="PORTB" dirreg="!TRISB"
                     pullups="!RBPU" >
arcachofo, thanks for the quick reply. It worked for input. I don't know what happened but i created a new circuit with the PIC16F84 and the circuit behaved strangely. The outputs wasn't working properly electrically. Everything where fine in the MCU monitor.

I saved the simulation and closed Simulide.
I opened it again and loaded the saved simulation and it worked perfectly, both output and input.

Sponsored content



Back to top  Message [Page 1 of 1]

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