Reading from two cascaded 82C54

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello out there,
I have a big problem. I try to access a Meilhaus me1400A-pci-board. This
board owns three 82C54-timer which I want to use as a counter.
To get more resolution I cascated the first two chips (controller0 and
controller1) this is possible by the api which comes with the driver
(this is available at sourceforge
http://sourceforge.net/projects/meilhaus). What is not available there
is a function to write and read from the cascated controllers. The usual
function for writing on a 16bit 82C54 is called "me1400CntWrite". My
solution of the problem looks like this:

    hiword = loadval >> 16;
    loword = loadval & 0xffff;
    if (( success = me1400CntWrite( 0, COUNTER01, MODE0, hiword + 1)) == 0)
    {
        me1400GetDrvErrMess(satz);
        printf ("Error while setting counter 1: %s\n", satz);
        exit(EXIT_FAILURE);
    }
    if (( success = me1400CntWrite( 0, COUNTER00, MODE2, loword + 1)) == 0)
    {
        me1400GetDrvErrMess(satz);
        printf ("Error while setting counter 0: %s\n", satz);
        exit(EXIT_FAILURE);
    }

BUT the problem now is, there is something wrong with that modes. There
are 6 different modes for the 82C54 and the counter should count down
from my inital-value (maybe 10000) to 0. After it reaches the 0 it
should shoot an interrupt and count further down to negative values. But
as it seems that does not work properly, because if I read out the
vallue inside my interrupt-service-routine (which is also the purpose of
the measurement) then I get result like 0.0156 seconds and that is far
too much for an interrupt! In hex a get some values like fffeb11d. Does
anybody here has some experience with that 82C54 and know which mode I
have to choose for counter0 and counter1.

Thank you very much.

hälsningar

Christian


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux