ast_enable(AST);
*
structast_config ast_conf;
* ast_conf.mode = AST_COUNTER_MODE;
* ast_conf.osc_type = AST_OSC_32KHZ;
* ast_conf.psel = AST_PSEL_32KHZ_1HZ;
* ast_conf.counter = 0;
* ast_set_config(AST, &ast_conf);
*
*
structast_calendar calendar;
*
structast_config ast_conf;
* calendar.FIELD.sec = 0;
* calendar.FIELD.min = 15;
* calendar.FIELD.hour = 12;
* calendar.FIELD.day = 20;
* calendar.FIELD.month = 9;
* calendar.FIELD.year = 12;
*
structast_config ast_conf;
* ast_conf.mode = AST_CALENDAR_MODE;
* ast_conf.osc_type = AST_OSC_32KHZ;
* ast_conf.psel = AST_PSEL_32KHZ_1HZ;
* ast_conf.calendar = calendar;
* ast_set_config(AST, &ast_conf)
We need to set the clock after prescaler to 1Hz.