2015-04-16 05:04 AM
I'm totally new to STM8 microcontroller series. I'm planning to do a project using STM8S003F3U controller in which ADC and timer module will be used.
It would be useful if i could find some sample codes for ADC,timers,etc. Is there any sample codes available? I have already downloaded the ST toolset which includes ST visual develop and ST visual programmer. I'm using cosmic c compiler. ST link/V2 emulator is used for debugging purpose. Am i going in the right track? Any help(even from the basics) would be appreciated.... #stm8s003f3 #stm8 #st-visual-develop2015-04-23 03:42 AM
Hello,
Download the STM8S standard peripheral library from the list (and any others you think might be relevant). http://www.st.com/stonline/stappl/productcatalog/app?page=partNumberSearchPage&levelid=SS1010&parentid=1754&resourcetype=SW The standard peripheral library gives some examples for each STM8 peripheral using ST's API's. Of course there is no reason why you wouldn't prefer to use direct register accesses, which brings you closer to the hardware and reading the register descriptions is a good start to knowing what one wants to set them to :) Hope that helps. Thanks, Ian2015-04-29 11:11 PM
Hi Ian,
Thanks for your reply. Im using IAR instead of stvd. I could create my sample project and successfully debugged it. It was working fine for few days. But today debug session terminated in the middle of debugging(an error shown saying location cant be accessed). After that, an error is shown whenever i try to download the code. The shown error is ''Failed to set configuration with MCU name STM8S003F3: SWIM error[30004]: comm timeout''Whats the solution to correct it?Thanks...2015-05-01 03:20 AM
Hello,
I'm not familiar with IAR but is the error coming from IAR or the ST/Link driver etc? Do you have another STM8 of the same or different type that works fine? I've never seen this message but I'm wondering if the flash has become locked/secured!?!? Can you get any access to the chip? Can you erase the chip etc? Thanks, Ian