stm8s timer

Status
Not open for further replies.
With the help of you guys and a bit of research, I managed to write the code without any error. There are a few lines that have to be added in the code, which I found in the examples given in the software. I don't know what these lines suggest, but as of now, it has worked. The lines are

#ifdef USE_FULL_ASSERT

/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

/* Infinite loop */
while (1)
{
}
}
#endif


I need your help one more time. I don't know how to set a timing value. In our project, at certain time, the timer should be switched ON. After the timer is enabled, a variable, say 'a' is incremented to a specific value. After that value is reached, we have to take specific actions, which can be performed in the code.
For e.g.
if(a==100)
{
//code
}
I was previously using PIC controller and mikroc, in which it was very easy to perform above steps. Not able to do the same with stvd.
Thanks in advance.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…