CPU Clock Setting error in enCoRe II with PSoC Designer v4.3

Question: The enCoRe II CPU clock is set to 24 MHz in Device Editor; however, it seems to run much slower. (or) I set the CPU clock to 24 MHz in Device Editor, but my OSC_CR0 register shows a value of 00h instead of 03h. What could be the possible reason?



This is a bug in PSoC Designer version 4.3. The settings in device editor for the CPU Clock don't tranfer to the configuration table. We need to do this manually or the CPU will always run at 3MHz.

To make these changes:-

Add the line in italics in the psocconfigtbl.asm file (This file is generated when you do a 'Generate Application' and can be found under 'Library Source') under Bank1 registers as shown below.

;  Global Register values
 db              e3h, 14h  ; VLDCR register (VLDCR)
 db              e0h, XYh                ; OSC_CR0 register
;  Instance name PITIMER12, User Module PITIMER12
;  Instance name USB, User Module USB
 db  ffh

X, Y values can change depending on desired CPU clock speed and Sleep Timer Clock frequency. Please refer to the OSC_CR0(location 0x1E0h) register in the enCoRe II datasheet for details.

Gotchas: DO NOT 'Generate Application' after you make these changes, PSoC Designer will invalidate/erase the changes. Alternatively, you can also write to the OSC_CR0 register in main.c to change to the desired frequency.