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
Copy file name to clipboardExpand all lines: README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,8 +59,9 @@ These commands must be run when the running status is `STOPPED`.
59
59
*`get <address (in hex)>` - Gets instruction at address. Returns output word and number of clock cycles separated by a space, in same format as `set`.
60
60
*`run` - Used to hardware start a programmed sequence (ie waits for external trigger before processing first instruction).
61
61
*`swr` - Used to software start a programmed sequence (ie do not wait for a hardware trigger at sequence start).
62
-
*`adm <number of instructions (in hex)>` - Enters mode for adding pulse instructions in binary.
63
-
* The number of instructions must be specified with the command. The Pi Pico will then wait for that enough bytes to fill that many instructions (6 times the number of instructions) to be read, and will not respond during this time unless there is an error. This mode can not be be terminated until that many bytes are read.
62
+
*`adm <starting instruction address (in hex)> <number of instructions (in hex)>` - Enters mode for adding pulse instructions in binary.
63
+
* This command over-writes any existing instructions in memory. The starting instruction address specifies where to insert the block of instructions. This is generally set to 0 to write a complete instruction set from scratch.
64
+
* The number of instructions must be specified with the command. The Pi Pico will then wait for enough bytes (6 times the number of instructions) to be read, and will not respond during this time unless there is an error. This mode can not be be terminated until that many bytes are read.
64
65
* Each instruction is specified by a 16 bit unsigned integer (little Endian, output 15 is most significant) specifying the state of the outputs and a 32 bit unsigned integer (little Endian) specifying the number of clock cycles.
65
66
* The number of clock cycles sets how long this state is held before the next instruction.
66
67
* If the number of clock cycles is 0, this indicates an indefinite wait.
// Check that the instructions will fit in the do_cmds array
530
-
if(inst_count+do_cmd_count >= MAX_DO_CMDS-3){
531
-
fast_serial_printf("Too many DO commands (%d + %d). Please use resources more efficiently or increase MAX_DO_CMDS and recompile.\r\n", do_cmd_count, inst_count);
531
+
if(inst_count+start_addr >= MAX_DO_CMDS-3){
532
+
fast_serial_printf("Invalid address and/or too many instructions (%d + %d).\r\n", start_addr, inst_count);
532
533
}
533
534
535
+
// reset do_cmd_count to start_address
536
+
do_cmd_count=start_addr*2;
537
+
534
538
// It takes 6 bytes to describe an instruction: 2 bytes for values, 4 bytes for time
535
539
uint32_tinst_per_buffer=SERIAL_BUFFER_SIZE / 6;
536
540
// In this loop, we read nearly full serial buffers and load them into do_cmds.
0 commit comments