Suggesting changes to PineBlasterV2 for the Wi-Fire board #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I tested V2 of PineBlaster to flash the Digilent Wi-Fire board, and it does not work as a pseudoclock for labscript. Since I'm not expert on this, by trial and error, and comparing with the first version I found what needs to be changed.
This was tested with Arduino IDE v1.6.7, chipKIT core version 1.3.1, and the Wi-Fire board.
Three changes will be necessary:
// Announce we are ready!
//Serial.println("ready");
This message is expected on BitBlaster but not on PineBlaster, so one of them needs to be modified to have the same .ino file working for both. Currently, if this line is removed it will work for Pineblaster but not for bitblaster. Maybe Pineblaster.py (in labscript devices) will need to be modified because Max32 and Wi-Fire have different specifications.
In void start_clock(), it seems "Serial.attachInterrupt(serialInterruptDuringRun)" does a full reset when the experimental sequence starts running in Blacs, LD1 flashes like when we reinicialize the device. In this case, Pineblaster.py,
def start_run(self):
# Start in software:
self.pineblaster.write(b'start\r\n')
breaks with the message " PineBlaster said ''o'', expected 'ok' ".
To make this part working I had to replace it by "reset_on_serial = 1 (and it's definition) imported from the first version of PineBlaster.
In these lines
// once the wait is complete, detach the interrupt so future triggers do not
// slow down the execution
detachInterrupt(0);
If we keep "detachInterrupt(0)" pineblaster.py does not receive "done", therefore I commented out this line.