Quad encoder in Configurable Custom Logic (CCL) - can it be simplified?

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Hi everyone,

 

I would like to implement a quadrature encoder on the new 8 pin ATtinys that has the least burden on the CPU as is reasonably possible, using the Configurable Custom Logic (CCL) features. I see that there's an example of this in the app note  http://ww1.microchip.com/downloads/en/AppNotes/Interf-Quad-Encoder-CCL-w-TCA-TCB-DS00002434C.pdf  but the downside of this approach for 8 pin devices is that it would use all potential 6 GPIOs and leave none for an interface to, say, a master controller uC. 

 

The reason I would like to do this is mainly to learn about squeezing the maximum performance out of these new ATtinys, so there's admittedly a somewhat hypothetical constraint in selecting the 8 pin devices. That said, I would appreciate any tactics that people can suggest about using the CCL/ Event System and other features to read a quad encoder. Do the timers in the app note need to be routed out through GPIOs or is there a different way of plugging the sequential logic together to determine direction without needing these extra four GPIOs (on top of the two that are from the encoder channels - PC4, PC5, PA3 & PA5) for TCB?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In some situations you can route through the event system.

You can also use a single pin, that is output for a peripheral but input for another, to route a signal.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:

In some situations you can route through the event system.

You can also use a single pin, that is output for a peripheral but input for another, to route a signal.

Thanks, I'll look into that.

 

El Tangas wrote:

You can also use a single pin, that is output for a peripheral but input for another, to route a signal.

Also thanks - although this would be less preferable to internal routing.

 

If this could be implemented with only 3 pins, we could leave UPDI/RESET alone and have an I2C interface. Not the fastest method but at least the master could program a set-and-forget value for the encoder to reach before the ATtiny informed the master.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

smerrett79 wrote:
... and have an I2C interface.
or one-wire.

AN2658 - USART in One-Wire Mode via ATTINY402 - 8-bit AVR Microcontrollers

 

"Dare to be naïve." - Buckminster Fuller