Skip to main content
debadutta reddy
Associate
Dec 20, 2017 8:58 AM UTC
Question

Source code is corrupting in STM8S003F3P6 microcontroller

Posted on December 20, 2017 at 09:58

Hello

I have developed a timer cum frequency meter using STM8S003F3P6 microcontroller. Interfacing a LCD to show the frequency and time. And also reading a remote switch (PLC realy switch), accordingly controlling(switching) an external driver board of a generator.

But the source code inside the micro controller is corrupting after several cycles of switching and the system becomes dead.   

After reprogramming the micro controller the system works normally.

Please guide me.... what could be the issue here?

programmer level fault or hardware level fault or any other ?

what I have to do to resolve this issue?

    This topic has been closed for replies.

    3 replies

    Philipp Krause
    Senior II
    Dec 20, 2017 11:25 AM UTC
    Posted on December 20, 2017 at 12:25

    My first guess would be a software bug, writing through uninitialized pointers.

    Philipp

    debadutta reddy
    Associate
    Dec 22, 2017 7:05 AM UTC
    Posted on December 22, 2017 at 08:05

    Thank you Philipp

    But I have checked the same code by switching with a manual switch (instead of PLC relay switch) so many times at the time no problem occurring.

    go through the attached file which is for PLC input to microcontroller.

    ________________

    Attachments :

    plc ckt.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hy4o&d=%2Fa%2F0X0000000b4r%2F4OTPCakTC0QPCMookTB42qYGR68yUt5XuzCwalIJr4Q&asPdf=false
    Associate III
    Jan 3, 2018 10:31 AM UTC
    Posted on January 03, 2018 at 10:31

    Based on your latest experiment, you are dealing with electromagnetic interference in the equipment. Try to improve the quality of blocking high-frequency interference in power supply circuits.