Skip to main content
Visitor II
July 30, 2010
Question

ICP(SWIM) Programming

  • July 30, 2010
  • 1 reply
  • 685 views
Posted on July 30, 2010 at 23:08

ICP(SWIM) Programming

    This topic has been closed for replies.

    1 reply

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:09

    > Should I send parity bit and wait for acknowledge or just push eight bits and then release line?

    parity bit should always be sent, and ack will be sent out by STM8.

    Actually, after you send the start sequency, an ack will also be sent out by STM8.

    Here is code to unlock flash and eeprom:

    static void stm8_unlock_eeprom_option(uint32_t dukr)

    {

     swim_wotf_reg(dukr, 0xAE, 1);

     swim_wotf_reg(dukr, 0x56, 1);

    }

    static void stm8_unlock_flash(uint32_t pukr)

    {

     swim_wotf_reg(pukr, 0x56, 1);

     swim_wotf_reg(pukr, 0xAE, 1);

    } Note that pukr maybe different between STM8S(A) and STM8L.