I'm playing with a nice new PIC16F15356, and investigating the Configurable Logic Cell (CLC) capabilities - basically a 4-cell mini-PLD on the chip that can take inputs from any of a list of 40 modules, including certain configurations of I/O pins.

But there seems to be no simple programmatic digital input capability. I was hoping to be able to set a "motor direction" bit from the code, which would be worked into the logic to generate my outputs. I could probably hack it by setting something like a PWM to "100%" or "0%" and feeding that in, but I was expecting there to be 4 bits of a register I could write to, and there isn't!

One way might be to dynamically reconfigure the CLC logic, on the fly, but my mind fills with the horrors of glitches, weird intermediate states, etc. Another is to write to a I/O pin, and then assign that as an input into the logic - that might be the best way.

Am I missing something, please?

  • \$\begingroup\$ You could feed in data from the serial drivers (EUSART or SPI). That would give you a one byte write (to the serial module) with a configurable clock for speed. Those modules also have interrupts to let you know when more data can be sent. \$\endgroup\$
    – David
    Mar 22, 2020 at 22:05
  • \$\begingroup\$ @David Fair enough - there's no more official way that my eyes have overlooked, then? Feel free to write "Nope you have to hack it!" (or similar) as an answer, if you like (otherwise I'll do so myself in a few days, if nobody else does) :-) \$\endgroup\$
    – SusanW
    Mar 24, 2020 at 20:03
  • \$\begingroup\$ I am considering the same issue, I will try changing the configuation setting registers to force a change of state e.g. change the invert/non-invert setting of a gate. \$\endgroup\$ Oct 8, 2020 at 3:44


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.