Pullup & Schmitt
The SX/B helpfile says that Pullup and/or Schmitt when used like this:
Only work on SX48/52.
Yet I've seen many example codes where its used for SX28s.
Is this a case of the helpfile not being updated with new information?
What about the TTL and CMOS commands?
RX PIN RC.0 INPUT PULLUP SCHMITT
Only work on SX48/52.
Yet I've seen many example codes where its used for SX28s.
Is this a case of the helpfile not being updated with new information?
What about the TTL and CMOS commands?
Comments
You cannot do this on the SX28:
... this only works on the SX48. The line of code you posted is fine because PULLUP and SCHMITT are used as modifiers of the PIN declaration.
The reason for the keywords only working on the SX48 is that the SX48 allows us to read certain configuration registers that are write-only on the SX28. The PIN declaration affects the internally-generated setup code (usually at Start) but once it's written in the SX28 we can't read it, and creating shadow registers would use more RAM space than one would want (shadow registers are used for TRIS which are also write-only on the SX28).
You should *study* this document if you're serious about the SX:
-- www.parallax.com/Portals/0/Downloads/docs/prod/sx/SxUsersManualV31.pdf
Table 2-4 shows that configuration registers for the SX28 are write only; table shows that configuration registers on the SX48 can be read -- this is what allows the TTL, CMOS, and SCHMITT keywords to work in the SX48. You can see for yourself by looking at the compiled code: in the SX48 the code will read a configuration register, modify the target bit, then write it back.
The SX takes more involvement that the BASIC Stamp and understanding the hardware will help you achieve your goals, even if using straight high-level SX/B.
Post Edited (JonnyMac) : 2/19/2009 5:31:06 PM GMT
Thanks
That said, I am updating the help file for Parallax and will add an another note vis-a-vis the CMOS, SCHMITT, and TTL instructions and the SX20/28
When I said I didn't understand the difference, I meant the difference between the PULLUP command and the PULLUP modifier.
Thanks though... its great to see that user feedback really makes a difference.
Still, don't be lulled into using this exchange as a reason not to study and experiment on your own; you've shown a habit of posting questions that are easily answered with a few minutes of experimentation and and, sadly, while you may get the answer you want from the forums I don't think your understanding of the process is complete without working it through on your own. But that's just my opinion... and we all know what those are like!
Here's then note I added to the SCHMITT page.
Note for SX18/20/28
The SX18/20/28 does not allow for the SCHMITT configuration of individual pins except in the context of the PIN declaration which affects the program start-up code. To change the SCHMITT configuration of a port during the operation of the program one must write to the ST_B or ST_C registers. On the SX18/20/28 the ST_B and ST_C registers are write-only.
I'm also going to change the check-mark icons on the aliases page to indicated read-only, write-only and read/write.
Post Edited (JonnyMac) : 2/19/2009 9:42:29 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Parallax Forums - If you're ready to learn, we're ready to help.