Hello,
i am trying to learn to setup GPIF2. I have created a GPIF2 design with the following properties:
- Master / Synchronous / Internal / 8 Bit Bus / no multiplexing / 1 input / 1 output / 2 DMA flag lines
- I have a state machine with 3 states:
-- Start state
-- STATE0: Which should set OUTPUT0 to e.g. 0
-- STATE1: Which should set OUTPUT0 to e.g. 1
Then i have 2 transitions: from STATE0 to STATE1 when INPUT0 is set and back when INPUT0 is reset (polarity does not matter at the moment).
I have attached screen shots of my design and state machine to this posting.
A) I expect that when i toggle INPUT0, then i see some reaction on OUTPUT0, but OUTPUT0 always remains 0.
B) I also expect that GPIO16 (CLK) is an output, but value is Z.
C) GPIO[0...7] is also Z, but perhaps this is correct?
D) GPIO[8...15] is 0, perhaps correct, because no used (more assumed it is Z)?
E) I also tried first without a state machine at all, changing "initial value" between high and low (of course re-compling and re-flashing), but no reaction. Therefore i am not sure, if i control the state machine at all?
This i my code to load and start GPIF (i get no error output, especially from these function, but of course other debug output):
CyU3PPibClock_t pibClock;
/* Initialize the p-port block. */
pibClock.clkDiv = 2;
pibClock.clkSrc = CY_U3P_SYS_CLK;
pibClock.isHalfDiv = CyFalse;
/* Disable DLL for sync GPIF */
pibClock.isDllEnable = CyFalse;
apiRetStatus = CyU3PPibInit(CyTrue, &pibClock);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "P-port Initialization failed, Error Code = %d\n",apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/* Load the GPIF configuration for Slave FIFO sync mode. */
apiRetStatus = CyU3PGpifLoad (&CyFxGpifConfig);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PGpifLoad failed, Error Code = %d\n",apiRetStatus);
CyFxAppErrorHandler(apiRetStatus);
}
/* Start the state machine. */
apiRetStatus = CyU3PGpifSMStart (START, ALPHA_START);
if (apiRetStatus != CY_U3P_SUCCESS)
{
CyU3PDebugPrint (4, "CyU3PGpifSMStart failed, Error Code = %d\n",apiRetStatus);
if(apiRetStatus == CY_U3P_ERROR_NOT_CONFIGURED) CyU3PDebugPrint (4, "-> CY_U3P_ERROR_NOT_CONFIGURED)\n");
if(apiRetStatus == CY_U3P_ERROR_ALREADY_STARTED) CyU3PDebugPrint (4, "-> CY_U3P_ERROR_ALREADY_STARTED)\n");
CyFxAppErrorHandler(apiRetStatus);
}
Have i missed something to enable GPIF? There is "isDQ32Bit", what value must it get when using 8 bit?
I have it on CyFalse, because i have not 32 bit interface.
|