Pages

Tuesday, April 30, 2013

Guzunty Pi - gz_test notes



Now I am doing the gz_test.  When I did this test the very first time, some weeks ago, I thought I need to set up the SPI connection.  Actually the CPLD is already programmed, through JTAG to do the counting down, so there is no need to execute anything.  The test program just create the clodk signal, which I later found was 9.6 Hz, the the first counted down signal at P1-01 is 586 Hz, which I later found in the documentation is counting down 13 times, if I remember correctly.

What is confusing is the 5MHz parameter.  I first thought the output is 5 MHz, but then I learnt that it is another mater clock divided down by 0x07f, or 10 Mhz divided by 0x7f times to get 586 Hz.  I have been too lazy to check out.  Anyway, I now know that if there is a 500+ signal at P1_01, then the CPLD should have been correctly programmed as an 8 stage binary counter, or something like that.


gz_clock_ena(GZ_CLK_5MHz, 0x07f);



#include <stdio.h>
#include <gz_clk.h>

int main(int argc, char* argv[])
{
  char aChar;
 
    gz_clock_ena(GZ_CLK_5MHz, 0x07f); // Turn on a slow clock
    printf("\nPress any key to stop test.");
    scanf("%c", &aChar);
    gz_clock_dis();
    return 0;
}

.END

No comments:

Post a Comment