Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions firmware/c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ pico_add_extra_outputs(picoemp)
# enable usb output, disable uart output
pico_enable_stdio_usb(picoemp 1)
pico_enable_stdio_uart(picoemp 0)

# Use 200MHz clock for pio, for 5ns precision in fast trigger mode
# RP2040 is certified to run at 200MHz, see https://github.com/raspberrypi/pico-sdk/releases/tag/2.1.1
add_definitions(-DSYS_CLK_MHZ=200)
2 changes: 1 addition & 1 deletion firmware/c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static uint offset = 0xFFFFFFFF;

// defaults taken from original code
#define PULSE_DELAY_CYCLES_DEFAULT 0
#define PULSE_TIME_CYCLES_DEFAULT 625 // 5us in 8ns cycles
#define PULSE_TIME_CYCLES_DEFAULT 1000 // 5us in 5ns cycles
#define PULSE_TIME_US_DEFAULT 5 // 5us
#define PULSE_POWER_DEFAULT 0.0122
static uint32_t pulse_time;
Expand Down
10 changes: 5 additions & 5 deletions firmware/c/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ static char serial_buffer[256];
static char last_command[256];

#define PULSE_DELAY_CYCLES_DEFAULT 0
#define PULSE_TIME_CYCLES_DEFAULT 625 // 5us in 8ns cycles
#define PULSE_TIME_CYCLES_DEFAULT 1000 // 5us in 5ns cycles
#define PULSE_TIME_US_DEFAULT 5 // 5us
#define PULSE_POWER_DEFAULT 0.0122
static uint32_t pulse_time;
Expand Down Expand Up @@ -160,10 +160,10 @@ bool handle_command(char *command) {
if(strcmp(command, "fa") == 0 || strcmp(command, "fast_trigger_configure") == 0) {
char **unused;
printf(" configure in cycles\n");
printf(" 1 cycle = 8ns\n");
printf(" 1us = 125 cycles\n");
printf(" 1ms = 125000 cycles\n");
printf(" max = MAX_UINT32 = 4294967295 cycles = 34359ms\n");
printf(" 1 cycle = 5ns\n");
printf(" 1us = 200 cycles\n");
printf(" 1ms = 200000 cycles\n");
printf(" max = MAX_UINT32 = 4294967295 cycles = 21475ms\n");

printf(" pulse_delay_cycles (current: %d, default: %d)?\n> ", pulse_delay_cycles, PULSE_DELAY_CYCLES_DEFAULT);
read_line();
Expand Down