Draft FAQ for "Digital I/O Ports" forum

A place to start writing FAQ posts for other forums. Make your daft in here, then it can be moved to the correct forum when complete.

Draft FAQ for "Digital I/O Ports" forum

Postby ric » Sat May 31, 2014 2:45 am

Topics
  • Port pins changing unexpectedly - the "Read-Modify-Write" problem
  • Inputs always reading as zero - Analog capable inputs default to analog mode
Port pins changing unexpectedly - the "Read-Modify-Write" problem
The following examples in Assembler and C do exactly the same thing:
Example assembler
Code: Select all
        clrf    PORTA   ;All pins low
        ....            ;some other instructions
        bsf     PORTA,0 ;raise RA0
        bsf     PORTA,1 ;raise RA1

Example C
Code: Select all
    PORTA=0;    //All pins low
    ....            //some other instructions
    PORTAbits.RA0=1    //raise RA0
    PORTAbits.RA1=1    //raise RA1


(More to write)

Inputs always reading as zero - Analog capable inputs default to "analog" mode
(To write)
Latest test project, an LED matrix display made from one reel of addressable LEDs. here
User avatar
ric
Verified identity
 
Posts: 659
Joined: Sat May 24, 2014 2:35 pm
Location: Melbourne, Australia
PIC experience: Professional 5+ years with MCHP products

Re: Draft FAQ for "Digital I/O Ports" forum

Postby Ian.M » Sat May 31, 2014 11:20 am

Some stuff you may wish to add that needs expanding:

* Capacitive Loading Specs on Output Pins 50pF max - consistent across 8 bit PIC families ever since the PIC16C devices
ToDo: Confirm loading specs for 16 and 32 bit families.
* Influence of loading and clock speed on RMW problem.
* Methods of avoiding RMW:
+ Use LATX if available (Dario's favourite 8-)
+ Shadowing
+ Avoidance by only using one output per port
+ Avoidance by only writing whole port
+ Mitigation by delays
* Link back to "RMW and solutions for it" http://www.microchip.com/forums/m478014.aspx
Ian.M
Verified identity
 
Posts: 95
Joined: Wed May 28, 2014 12:47 am
PIC experience: Professional 1+ years with MCHP products


Return to FAQ Factory

Who is online

Users browsing this forum: No registered users and 4 guests

cron