| ??? 11/23/02 21:26 Read: times |
#33036 - RE: 32 bit up/down counter ? |
Hi:
In most of the applications where I interface to an encoder and the two channel hookup with both Ch A and Ch B is used in order to gain direction information I use a chip from Hewlett Packard. The data sheet for the HCTL-2020 chip will be interesting for you to look at. When I use this with a microcontroller in a high speed application I use the internal 12 bit counter to accumulate the low order bits of the count and then connect the count cascade outputs to the pins on the microcontroller. These pins can either be polled or set to drive an interrupt so that the microcontroller software can extend the count to whatever resolution you desire in memory locations. For low speed applications it is suitable to connect the cascade outputs (available just on the HCTL-2020) of the chip to the microcontroller and count each and every step in the software. If you use the chip's internal counter you need to provide a way to read the count out of the part. One way to do this is to configure your 8051 with an XRAM bus interface and then make an address decode which enables the read of the HP chip. The other way is to simply hang the output bus of the part to port pins and bit bang read the count. It is also possible to use this part in a way whereby you simply poll the count from the internal counter on a repeatitive basis and watch for count roll-overs or roll-unders. When a roll over/under is seen you can increment / decrement an in memory counter that extends the number of bits that you require. Note the HP part family (see the data sheet) is offered in a 12 bit and a 16 bit counter size. When you use the count poll method it is a requirement to poll the chip often enough that the counter in the HP part cannot roll over / under more than one time at your highest encoder speed. When I have used the poll method I derived the polling period from a timer interrupt. This chip works VERY well. Timing diagrams are included in the data sheet. Have Fun...... Michael Karas |
| Topic | Author | Date |
| 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: beware | 01/01/70 00:00 | |
| RE: beware and please | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
| RE: 32 bit up/down counter ? | 01/01/70 00:00 | |
RE: 32 bit up/down counter ? | 01/01/70 00:00 |



