You are reading a single comment by @Georg and its replies. Click here to read the full conversation.
  • With this:

    var loop = E.asm("void()",`
        ldr    r2, port_A  //Load port_A in r2
        movw   r3, #57344  //Load mask in r3
    loop:
        str    r3, [r2, #0]  //Set is r2
        str    r3, [r2, #4]  //Clear is r2+4
        b loop
        nop
        nop
    port_A:
      .word    0x40010810
    `);
    
    LED1.write(0);
    LED2.write(0);
    LED3.write(0);
    
    

    loop()

    It takes 223 ns to loop once, but three cpu cycles @72MHz are 3*1e9*1/72e6= 41.6 ns, can I touch some clock setting somewhere to make it toggle faster?

    Thanks,


    1 Attachment

    • gpio.jpeg
About

Avatar for Georg @Georg started