Digilent PmodCLP Manual de referência - Página 3

Procurar online ou descarregar pdf Manual de referência para Unidade de controlo Digilent PmodCLP. Digilent PmodCLP 4 páginas. Parallel lcd display module
Também para Digilent PmodCLP: Manual de referência (6 páginas)

Digilent PmodCLP Manual de referência
PmodCLP Library: CLP Demo
Resources Used
Timer5 configuration is done using Plib macros in AppInit function. SFRs approach is also provided in
the commented code.
Plib macro used:
OpenTimer5(T5_ON | T5_SOURCE_INT | T5_PS_1_8, 99);
ConfigIntTimer5(T5_INT_ON | T5_INT_PRIOR_7 | T5_INT_SUB_PRIOR_3);
Meaning:
T5_ON – timer 5 is ON.
-
-
T5_PS_1_8 (Prescaler 1/8): so the frequency is 1/8 of Peripheral bus freq, which is 1/8 of
SYSCLK (65 MHz) = 1 MHz
-
Period = 99, so Timer period = (99 + 1) * 1/1MHz = 100 us
-
T5_SOURCE_INT : Timer5 triggers interrupt
T5_INT_ON – T5 interrupt is ON
-
-
T5_INT_PRIOR_7, T5_INT_SUB_PRIOR_3 - timer interrupt priority level 7, subpriority level
3
More information about Timer5 is shown in Timer5Handler.
Functions defined in main.c
void __ISR(_TIMER_5_VECTOR, ipl7) Timer5Handler(void)
Parameters:
None
Interrupt service routine for Timer 5interrupt. Timer 5 is used to perform software debouncing
of the on-board buttons.
int main(void)
Parameters:
none
Main program module. Performs basic board initialization (by calling DeviceInit and AppInit)
and then enters the main program loop, where steps are cycled. For every step,
WaitUntilBtnPressed is called in order to wait for the buttons.
void WaitUntilBtnPressed(BOOL *pfBtn1Process, BOOL *pfBtn2Process)
Parameters:
pfBtn1Process
pfBtn2Process
www.digilentinc.com
Copyright Digilent, Inc. All rights reserved. Other product and company names mentioned may be trademarks of their respective owners.
Digilent file, also used in other applications.
It was not modified for this application.
used as output parameter fTrue if the button 1 causes
processing fFalse if the button 1 does not cause processing.
used as output parameter fTrue if the button 2 causes
processing fFalse if the button 2 does not cause processing.
Digilent, Inc.
page 3 of 4