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.

16F88 PORTA failed to give output

Status
Not open for further replies.

lipschutz

Member
Dear All,
I am failed to find any output at PORTA. Therefore i wrote the code as basic input output test. And run on MPLAB 8 Simulatore. But no result failed again and again. Please find the code below and help me to know the solution:

Code:
;Test Output at PORTA
;
 processor 16F88
 include<p16f88.inc>
 __CONFIG _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_OFF & _INTRC_IO
 __CONFIG _CONFIG2,_IESO_OFF & _FCMEN_OFF
;=============================================================================
;BIT DEFINITION
RA0        EQU      0H
RA1        EQU      1H
RA2        EQU      2H
;
;
                       ORG         0H
                   BANKSEL         OSCCON      ;
                   CLRF            OSCTUNE     ;
                   CLRF            OSCCON      ;
                   MOVLW           B'00001110' ;
                   MOVWF           OSCCON      ;
;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                   BANKSEL         PORTA       ;
                   MOVLW           B'000100000';
                   TRIS            PORTA       ;
;*************************************************************************
                   CLRF            PORTA       ;
HERE               BSF             PORTA,0H    ;
                   BSF             PORTA,1H    ;
                   BSF             PORTA,2H    ;
                   BCF             PORTA,0H    ;
                   BCF             PORTA,1H    ;
                   BCF             PORTA,2H    ;
                   GOTO            HERE        ;
                   END
 
You need to turn off the analogue feature of the port pins. Set ansel and anselh to zero.

Mike.
 
Status
Not open for further replies.

Latest threads

Back
Top