You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is clear that the value read is not zero (DATAx bits for output lines + PINx bits for inputs) and avr_ioport_pin_write flips them all causing incorrect operation (disabling pull-ups for inputs, inverting all outputs, not the only one intended to be inverted).
Likely need to distinguish this marginal use case somewhere, maybe right in SBI simulator handler.
OFF THE TOPIC Just to do not create an extra issue. I looked through the code briefly, and I cannot see if external reset (by means of RESET pin) is supported. Does anybody know for sure?
UPD
simplest way is to use avr_ioport_write instead of avr_ioport_pin_write for this, after detecting that we dealing with PINx port.
Thanks
The text was updated successfully, but these errors were encountered:
Hi,
Current SBI simulation implementation works wrong when the target is PINx register.
The code:
That is we read (with avr_ioport_read) port value, then ORing it with a bit to set, then pushing it back (via avr_ioport_pin_write).
It is clear that the value read is not zero (DATAx bits for output lines + PINx bits for inputs) and
avr_ioport_pin_write
flips them all causing incorrect operation (disabling pull-ups for inputs, inverting all outputs, not the only one intended to be inverted).Likely need to distinguish this marginal use case somewhere, maybe right in SBI simulator handler.
OFF THE TOPIC Just to do not create an extra issue. I looked through the code briefly, and I cannot see if external reset (by means of RESET pin) is supported. Does anybody know for sure?
UPD
simplest way is to use avr_ioport_write instead of
avr_ioport_pin_write
for this, after detecting that we dealing with PINx port.Thanks
The text was updated successfully, but these errors were encountered: