Application Note
13 of 45
001-84858 Rev. *N
2021-03-23
PSoC 4 Programming Using an External Microcontroller (HSSP)
Calculating HSSP Timeout Parameters
5
Calculating HSSP Timeout Parameters
Modify the values of the timeout parameters defined in the
Timeout.h
file according to the host programmer
used.
A separate test project
, “
C_Hssp_TimeoutCalc,
” is provided with the application note
. This project illustrates
the procedure to calculate the timeout parameters for a PSoC 5LP host programmer. Create a similar test
project for any other host programmer to calculate those timeout values.
The test project provides test functions in two files:
TimeoutCalc.h
and
TimeoutCalc.c
. These test functions
toggle a test pin during code execution. The timeout parameters are measured by measuring the LOW pulse
width of the signal on the test pin using an oscilloscope.
To calculate these timeout parameters, see the explanation in the macro definitions in the
TimeoutCalc.h
header file of the project. Now look at the significance of each of these timeout values:
5.1
DEVICE_ACQUIRE_TIMEOUT
This macro is used in the function
DeviceAcquire()
in the
ProgrammingSteps.c
file. To program the device,
the device must be acquired within the maximum time window for acquiring the device after you do a device
reset using the XRES pin. Maximum time window for acquiring the device is defined:
Table 9
Timeout for Acquiring Device
Device Family
Timeout (ms)
1
PSoC40xx
2.0
PSoC41/42xx
1.5
PSoC4xxxM
2.0
PSoC 4xxxL
2.0
PSoC4xx7_BLE / PSoC4xx8_BLE
2.0
PSoC 4000S/ PSoC 4100S/ PSoC 4100PS
2.0
PSoC 4100S Plus
5.0
Note:
The recommended minimum frequency of the SWDCK clock, which meets the timing requirement
to acquire the device, is 1.5 MHz. See
the “
Step 1. Acquire Chip
” subsection of the
programming
specifications document of the respective device listed in the
section for
more details.
The device-acquiring sequence consists of two steps:
1.
Do a line Reset, which is a standard ARM command to reset the debug access port (DAP).
2.
Read the DAP.
DEVICE_ACQUIRE_TIMEOUT indicates the maximum number of times a host can send the device-acquiring
sequence in a specific time window after device reset as given in
To calculate this macro, uncomment the
TestModeTimeout()
function in the
main.c
file of the project, and
then program the device.
1 The timeout for acquiring the device in the case of Power Cycle mode programming must be longer, ~ 30 ms.