Shop OBEX P1 Docs P2 Docs Learn Events
Reference for Smart Pin Registers — Parallax Forums

Reference for Smart Pin Registers

Does anyone know where to find a reference for the smart pin registers?
The datasheet describes registers X and Y as mode-specific parameters but does not elaborate on that.
Some examples use the X register to set the pin frequency for serial communication. Where does that knowledge come from?

Thanks in advance!

Comments

  • JonnyMacJonnyMac Posts: 9,158
    edited 2021-10-10 18:27

    In the P2 docs the use of X and Y registers is discussed individually for each smart pin mode. Docs are here:

    -- https://docs.google.com/document/d/1gn6oaT5Ib7CytvlZHacmrSbVBJsD9t_-kmvjd7nUR6o/

    Sometimes the register use is a bit detailed -- but it is spelled out. Fore example:

  • Thanks for the doc link. Couldn't find it on the website.

    Nonetheless, this information seems to be missing for the synchronous serial modes.

    Is it right to assume no functionality for all not mentioned register bits for all modes? As for the above example there is no mention of the y register.

    I would suggest putting tables with the bit mapping under every mode for each register.

  • As for the above example there is no mention of the y register.

    You're joking, right?

    I would suggest putting tables with the bit mapping under every mode for each register.

    Give an example of how you'd do it -- Parallax is very open to good ideas. Until then, I would suggest you spend more time studying the docs, as many of us have built objects and code using the smart pins with the docs that exist as they do now.

    Nonetheless, this information seems to be missing for the synchronous serial modes.

    No, it isn't. I wrote the attached flash object using synchronous transmit and receive using the existing documentation.

  • Sorry for not reading carefully enough that's on me. But I think for a general reference document the register should not be explained using only the method to manipulate the register. I just started with the propeller today and maybe I will get used to this style.

    Here is what I had in mind for the table. This is a snippet from a STM doc. As soon as I find all the register references I will give an example for the Propeller 2:

    As for the synchronous serial mode I really can not find it in the above linked document:

  • JonnyMacJonnyMac Posts: 9,158
    edited 2021-10-10 20:53

    I don't find your example useful vis-a-vis the X and Y registers given they're not very granular (I think ASYNC serial is the worst case). The mode register is complex, but spelled out very well in the P2 documentation cited above, and Propeller compilers include constants for all of the options available to the mode register. You can find those constant names in the Built-In Symbols for Smart Pin Configuration section of the Spin2 online documentation. If you looked at my flash object you saw a few of those in use (e.g., P_SYNC_RX, P_SYNC_TX, P_PULSE, etc).

    Spin2 docs:
    -- https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/

    I just started with the propeller today

    You might want to settle in and do a bit of reading before lobbing a lot of criticism -- especially about the [temporary] online documentation. The official manual is in preparation now.

  • Jon makes a really good point and unless you have been following the P2 saga, you might not be aware that everything published so far on the P2 is sort of “interim” in nature.

    I share your criticism that the docs are not perfect. I find them useful but frustating at times because I’m used to copious standardization and diagrams. But understand that improved docs are coming, and from what I hear they will be every bit the equal of the P1 docs (which I thought were frankly amazing).

    So hang in there @jayey because better days are ahead. We’ve just got to hang tight until we get there. In the interim, mine the forum and ask away! We’re all in the same boat.

  • evanhevanh Posts: 16,027
    edited 2021-10-11 02:25

    Jayey,
    Don't mind Jon. He's developing a short fuse these days. ;)

    Somewhat unrelated info, but I'll raise it now in the hopes it'll help you later ... The mode register written by WRPIN has two distinct sections:

    • A large field labelled P. This is for the low level pin modes that exist as custom circuits in the physical outer ring of the silicon chip. Stuff like DAC, ADC, comparator and pin registering. The P field is separately broken into sub-fields that are themselves mode dependant.
    • The non-P fields of WRPIN are for smartpin mode select, and routing selection. Each smartpin has a X, Y and Z register; accessed with WXPIN, WYPIN and RDPIN respectively. X and Y are mostly parameters or write data but can be sub-mode select for some smartpin modes. Z is always read data.

    We made a block diagram of the I/O section a while back, it should help you too - https://forums.parallax.com/discussion/171420/smartpin-diagram-now-with-p-p-bit-mode-table/p1

Sign In or Register to comment.