digital i o on the pic32 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Digital I/O on the PIC32 PowerPoint Presentation
Download Presentation
Digital I/O on the PIC32

Loading in 2 Seconds...

play fullscreen
1 / 24

Digital I/O on the PIC32 - PowerPoint PPT Presentation


  • 131 Views
  • Uploaded on

Digital I/O on the PIC32. Heigh -Ho, Heigh -Ho, it’s off the chip we go!. Ports. Our device has seven ports, labeled A – G, each consisting of sixteen bits. The rightmost bit position is BIT_0.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Digital I/O on the PIC32' - illiana-avila


Download Now An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
digital i o on the pic32

Digital I/O on the PIC32

Heigh-Ho, Heigh-Ho,it’s off the chip we go!

ports
Ports
  • Our device has seven ports, labeled A – G, each consisting of sixteen bits. The rightmost bit position is BIT_0.
  • Each port is controlled by three special function registers (SFRs): TRISx, ODCx, and LATx, e.g., TRISA for port A.
  • Each bit of a port can be individually controlled.
  • The SFRs are each 32-bits, but only the 16 LSB affect port bits.
portx versus latx
PORTx versus LATx
  • A fourth SFR, PORTx, is used to access pins
  • Writing to PORTx loads the LATx register. Equivalent to writing to LATx
  • Reading from PORTx reads the synchronized logic value on the external pin
  • Reading from LATx reads the LATx contents, not the pin!!!
  • Advice: Read from PORTx, write to LATx
additional sfrs
Additional SFRs
  • Additional SFRs are defined to facilitate common port operations: CLR, SET, INV
  • Associated with each of the four SFRs, e.g., TRISxCLR, PORTxINV
  • Operation on a particular bit is enabled by a ‘1’ in the corresponding bit position of a mask
  • For example, LATBINV = 0x000C toggles bits 2 and 3 of Port B
  • Equivalent to LATBINV = (BIT_2 | BIT_3)
peripheral libraries
Peripheral Libraries
  • Under “Help” or in Peripheral Library Guide
  • Simplifies configuration
  • More readable and portable
  • Individual bits selected via a bit mask, e.g.

PORTWrite(IOPORT_B, (BIT_2 | BIT_4);

where s that pin
Where’s that Pin?!?!
  • A couple of ways to find the information. For example, button to LED.
    • Look at the Cerebot RM, p. 9 or 30
    • Verify against Cerebot schematic, p. 5
    • Verify against PIC32 DS, p. 15 or 38
noise margins drive and load
Noise Margins, Drive and Load
  • Output voltage requirements (under load)
  • Input voltage requirements
  • Noise margin is the difference between the “worst” output voltage and the “worst” input voltage
  • Input leakage current
  • Absolute maximums (!!!)
noise margin calculation
Noise Margin Calculation
  • NMH = Voh_min – Vih_min = 2.4 – 0.65*3.3 = 255 mV with -10 mA load
  • NML = Vil_max - Vol_max = 0.2*3.3 – 0.4 = 260 mV with 10 mA load