2012-04-25 01:19 AM
I think this is wrong:
CONST uint8_t SYSDivFactor[5] = {1, 2, 4, 8, 16}; /*!< Holds the different Master clock Divider factors */
It should be like this:
CONST uint8_t SYSDivFactor[8] = {1, 2, 4, 8, 16, 32, 64, 128}; /*!< Holds the different Master clock Divider factors */
Because of this:typedef enum {
CLK_SYSCLKDiv_1 = (uint8_t)0x00, /*!< System Clock Divider: 1 */ CLK_SYSCLKDiv_2 = (uint8_t)0x01, /*!< System Clock Divider: 2 */ CLK_SYSCLKDiv_4 = (uint8_t)0x02, /*!< System Clock Divider: 4 */ CLK_SYSCLKDiv_8 = (uint8_t)0x03, /*!< System Clock Divider: 8 */ CLK_SYSCLKDiv_16 = (uint8_t)0x04, /*!< System Clock Divider: 16 */ CLK_SYSCLKDiv_32 = (uint8_t)0x05, /*!< System Clock Divider: 32 */ CLK_SYSCLKDiv_64 = (uint8_t)0x06, /*!< System Clock Divider: 64 */ CLK_SYSCLKDiv_128 = (uint8_t)0x07 /*!< System Clock Divider: 128 */} CLK_SYSCLKDiv_TypeDef;Right?