View Index by Level
RANDOM PAGE

SITE SEARCH

LOG
IN

SIGN UP

HELP

IO Ports


This is the AQA version closing after June 2019. Visit the the version for Eduqas instead.

To gain access to revision questions, please sign up and log in.

A2

Tristate Input Output Ports

PORTA, PORTB and PORTC

TRISA, TRISB and TRISC

Data I/O Example

CTRL+Click here to run the simulator.

Send data to four of the eight LEDs. Click (red highlight) to connect the LEDs to PORTA.

Assm-LEDs.gif

INIT:
    MOVW    0xF0    ; IIIIOOOO
    MOVWR   TRISA   ; PORTA has four
                    ; inputs and four
                    ; outputs
LOOP:
    MOVW    0xAA    ; 10101010 test data
    MOVWR   PORTA   ; Write data to PORTA
    MOVW    0x55    ; 01010101 test data
    MOVWR   PORTA   ; Write data to PORTA
    JMP     LOOP

 

 

 

reviseOmatic V3     Contacts, ©, Cookies, Data Protection and Disclaimers Hosted at linode.com, London