• PicŪ Basic


  • 16-bit devices: Peripheral Functons, Pins and PPS

    This is a short description of how to match pins and peripheral functions and how to determine which values to use.
    The need for this came up when charliecoultas asked a question about ICSP. Furthermore I wanted to understand myself...

    Now there are of course the PPS macro's and all symbols declared for you, but sometimes you just want to know how Les came up with RPOR7 = 3 in the manual.

    The datasheet I used is that of the 24HJ128GP502.

    Output:
    We want to send data through UART1.
    First select a pin for the function you want.
    e.g. pin 25. That's RB14
    Note the RP number for this pin.
    pin25 > RP14

    Select the value for the funcion UART1 Transmit from table 11-2.
    That is U1TX.
    Look at table 4-20 and find out which RPOR is associated with RP14.
    That's RPOR7.
    U1TX has a value of 3

    Result: RPOR7 = 3.

    Input:
    Suppose we also need to receive.
    Since we selected UART1 in the previous example, it makes sense to use this here too.
    We want to use pin 24.
    Pin: 24, RB13, that's RP13.
    Table 11-1 shows us that Uart1 Receive is Register RPINR18, the configuration bits U1RXR<4:0>
    Look up the Register RPINR18.
    Now what value do you need, it is not explained in detail.
    Just my interpretation: for RP25 the value to be used is 25, for RP0 the value is 0.
    Does that make sense? It does to me.

    Result: U1RXR = 13

    That's all for now

    Harm
  • Recent Activity

    towlerg-21522

    PIC18F1330 PLL problem

    Thread Starter: rcurl

    I'm just starting out on a new project that uses a PIC18F1330. I haven't used this specific chip before, so I began by trying to blink an LED just...

    towlerg Yesterday, 16:26 Go to last post
    towlerg-21522

    Pic16f18877 oread

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the OREAD command doesn't seem to work. The code is working on a PIC16F1939. Both controllers use 32MHz int osc. If i...

    towlerg Yesterday, 16:25 Go to last post
    palamont-28794

    MID$ Problem with a PIC18F25K22

    Thread Starter: palamont

    Hi everybody, I encounter a strange problem : I have a string of 230 characters. This string is divided into 10 segments of 23 characters, with a...

    palamont Yesterday, 10:08 Go to last post