Shop OBEX P1 Docs P2 Docs Learn Events
"01010 PWM switch-mode power supply, V and I feedback" P2 Smart Pin question(s) — Parallax Forums

"01010 PWM switch-mode power supply, V and I feedback" P2 Smart Pin question(s)

has anyone used this mode?
is there a circuit for doing this?
any code for doing this?

what does this mode even do?

it seems slick to, not only keep a load power from drooping, but also to sense, for example, motor stall?
could it do that?

Comments

  • evanhevanh Posts: 15,218

    I've used it once so far. Not for any switchmode function though. It's the only smartpin mode that has both input and output components and as such I was able to make it perform a conditional clock function - https://forums.parallax.com/discussion/comment/1552342/#Comment_1552342

        _pinstart( PIN_CLK, P_PWM_SMPS | P_OE | P_INVERT_OUTPUT |    // SD clock gen smartpin
                    (PIN_CMD - PIN_CLK & 7)<<28 | P_INVERT_A |    // smartA input select
                    (PIN_CMD - PIN_CLK & 7)<<24 | P_INVERT_B,    // smartB input select
                    1 | 10<<16, 5 );
    

    It generates an even square wave on its output while its smartB input is high.

    Note the sysclock/10 clock rate. The function needs to terminate the SD clock output within the same SD clock cycle that smartB goes low. There is I/O staging and the smartpin is synchronously clocked itself ... which means it still takes a few sysclock ticks to respond to a changed input. The large divide by 10 is needed for reliable response when sysclock is overclocked in the high 300's MHz.

  • @evanh said:
    I've used it once so far. Not for any switchmode function though. It's the only smartpin mode that has both input and output components

    curious.... thanks for the new idea!

Sign In or Register to comment.