13.07.2015 Views

Data Acquisition

Data Acquisition

Data Acquisition

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• A simple read operation• A counter latch command or• A read-back command.The results of the read operation are read from the counter’s data register, in theprogrammed format (LSB, MSB or LSB then MSB) of that counter.This is called reading a counter, and may take ‘one physical CPU read’ instruction(LSB or MSB) or ‘two physical CPU read instructions’ (LSB then MSB).The simple read operation consists of reading the contents of the desired counter's dataregister. The clock input of the counter must be disabled for this to be successful,otherwise the count may be in the process of changing when it is read, returning acompletely erroneous count value. The clock input may be disabled with the gate input orwith external logic.A counter latch command is invoked by writing a special type of control word to thetimer/counter’s control register, TCCTRL.The format of the control word for a counter latch command is diagrammed below.Figure D.8TCCTRL register – counter latch commandBits SC 1 and SC 0 select the counter whose count is to be latched. 00 selects counter 0,01 selects counter 1 and 10 selects counter 2.The selected counter’s output latch, latches the count at the time the counter latchcommand is received. The count is held in the latch until it is read (or the counterreprogrammed). The count is then automatically unlatched and the output latch returns tofollowing the counting element. Multiple counter latch commands may be used to latchmore than one counter. Each latched counter holds its count until read. Counter latchcommands do not affect the programming of the counter in any way.If a counter is latched, any subsequent counter latch commands to the same counter,before the count has been read, will be ignored. When read, the count value returned willbe the count at the time the first counter latch command was issued.A read-back command is issued by writing a special type of control word to thetimer/counter’s control register, TCCTRL. Read-back commands may be used to latchone or more counter’s current count value and/or status information.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!