Status: New
Owner: ----
Labels: Type-Enhancement Priority-Medium Component-Peripheral Component-Device

New issue 156 by sebastien.lelong: Peripheral Pin Select and device files
http://code.google.com/p/jallib/issues/detail?id=156

Hi Rob,

I'm currently working on PPS module, which allows to arbitrarily map function to remappable pins. This is a very nice feature, only available for recent PICs.

Searching PPSCON register, I've identified:
  - 39964B: J53 family
  - 39932D: J11 family
  - 39931D: J50 family
  - 39974A: J13 family

Using PPS is done 2 different ways whether the mapped function is an input or output. For input, the logic is assign a remappable pin number to a function.
Ex:    RPINR16_RX2DT2 = 9  -- assign pin RP9 to RX2 function (EUSART2)

For output, the logic is reversed, you assign a function to a pin number.
Ex: RPOR10_RPOR = 6 -- assign TX2 function (which has the ID number 6) to remappable pin RP10

I'm currently writing a library to deal with PPS, I'm not sure far I can go with this, but I'd need to use aliases for output function, as a first step. Trouble is their ID values aren't normalized. Considering TX2 function:

  - J53: TX2 has n°6 (table 10-14, page 162)
  - J11: TX2 has n°5 (table 10-14, page 152)
  - J50: TX2 has n°5 (table 10-14, page 152)
  - J13: TX2 has n°6 (table 10-14, page 160)

I wad thinking these differences could be hidden in device files, which would actually declares these aliases:

const byte PPS_TX2_CK2 = 6 -- or 5, etc...


Does it make sense to you ? Do you see another way to do this ? Should I edit devicepsecific.json, and if so, can you provide some guidelines (format) ?

Cheers,
Seb



--
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to