PSoC CY8CTMG20x and CY8CTST200 TRM, Document No. 001-53603 Rev. *C
37
Supervisory ROM (SROM)
3.1.2.8
Checksum Function
The Checksum function calculates a 16-bit checksum over a
user specifiable number of blocks, within a single Flash
bank starting at block zero. The BLOCKID parameter is
used to pass in the number of blocks to checksum. A
BLOCKID value of '1' calculates the checksum of only block
0, while a BLOCKID value of '0' calculates the checksum of
the entire Flash bank.
The 16-bit checksum is returned in KEY1 and KEY2. The
parameter KEY1 holds the lower 8 bits of the checksum and
the parameter KEY2 holds the upper 8 bits of the checksum.
3.1.2.9
Calibrate0 Function
This function may be executed at any time to set all calibra-
tion values. However, it is unnecessary to call this function.
This function is simply documented for completeness. The
calibration values are accessed by way of the TableRead
function, which is described in the section titled
.
3.1.2.10
Calibrate1 Function
While the Calibrate1 function is a completely separate func-
tion from Calibrate0, they perform the same task, which is to
transfer the calibration values stored in a special area of
Flash to their appropriate registers. What is unique about
Calibrate1 is that it calculates a checksum of the calibration
data and, if that checksum is determined as invalid,
Calibrate1 causes a
hardware reset
by generating an inter-
nal reset. If this occurs, it is indicated by setting the Internal
Reset Status bit (IRESS) in the CPU_SCR1 register.
The Calibrate1 function uses SRAM to calculate a check-
sum of the calibration data. The POINTER value is used to
indicate the address of a 38-byte buffer used by this func-
tion. When the function completes, the 38 bytes are set to
00h.
An
MVI A, [expr]
and an
MVI [expr], A
instruction
are used to move data between SRAM and Flash. There-
fore, the
MVI
write pointer (MVW_PP) and the
MVI
read
pointer (MVR_PP) must be specified to the same SRAM
page to control the page of RAM used for the operations.
Calibrate1 was created as a sub-function of SWBootReset
and the Calibrate1 function code was added to provide
direct access. For more information on how Calibrate1
works, see
SWBootReset Function on page 34
.
This function may be executed at any time to reset all cali-
bration values. However, it is unnecessary to call this func-
tion. This function is simply documented for completeness.
The calibration values are accessed by way of the
TableRead function, which is described in the section titled
3.1.2.11
WriteAndVerify Function
WriteAndVerify is the recommend function for modifying one
block of data in Flash. The WriteAndVerify function works
exactly the same as the WriteBlock function except that the
flash data is verified after the Write. The execution time is
Table 3-14. Flash Tables with Assigned Values
Table 0
Silicon ID Low Byte
Reserved
Table 0
Silicon ID High Byte
Expected Numbers =
# Bits Used to Encode =
Max Values (including 0) =
Bits Targeted =
Reserved
Table 1
IMO 6 MHz
trim
IMO 12
MHz trim
IMO 24 MHz trim
IMO 24 MHz
USB trim (high
power)
Reserved
Table 2
Reserved
Table 3
Reserved
Table 3-15. Checksum Parameters (07h)
Name
Address
Type
Description
KEY1
0,F8h
RAM
3Ah.
KEY2
0,F9h
RAM
Stack Pointer value+3, when
SSC
is
executed.
BLOCKID 0,FAh
RAM
Number of Flash blocks from which to
calculate the checksum.
Table 3-16. Calibrate0 Parameters (08h)
Name
Address
Type
Description
KEY1
0,F8h
RAM
3Ah.
KEY2
0,F9h
RAM
Stack Pointer value+3, when
SSC
is
executed.
Table 3-17. Calibrate1 Parameters (09h)
Name
Address
Type
Description
KEY1
0,F8h
RAM
3Ah.
KEY2
0,F9h
RAM
Stack Pointer value+3, when
SSC
is
executed.
POINTER
0,FBh
RAM
First of 30 SRAM addresses used by
this function.
MVR_PP
0,D4h
Register
MVI
write page pointer.
MVW_PP
0,D5h
Register
MVI
read page pointer.
Summary of Contents for PSoC CY8CTMG20 Series
Page 4: ...4 Contents Overview Feedback...
Page 26: ...26 PSoC CY8CTMG20x and CY8CTST200 TRM Document No 001 53603 Rev C Section B PSoC Core Feedback...
Page 82: ...82 PSoC CY8CTMG20x and CY8CTST200 TRM Document No 001 53603 Rev C Sleep and Watchdog Feedback...
Page 134: ...134 PSoC CY8CTMG20x and CY8CTST200 TRM Document No 001 53603 Rev C I2C Slave Feedback...
Page 142: ...142 PSoC CY8CTMG20x and CY8CTST200 TRM Document No 001 53603 Rev C System Resets Feedback...
Page 160: ...160 PSoC CY8CTMG20x and CY8CTST200 TRM Document No 001 53603 Rev C SPI Feedback...
Page 182: ...182 PSoC CY8CTMG20x and CY8CTST200 TRM Document No 001 53603 Rev C Full Speed USB Feedback...
Page 302: ...302 PSoC CY8CTMG20x and CY8CTST200 TRM Document No 001 53603 Rev C Glossary Feedback...