From a575703db06e86d73b8f86cffe21f76c28a30430 Mon Sep 17 00:00:00 2001 From: DragonflyPS Date: Tue, 19 Mar 2024 08:27:04 -0700 Subject: [PATCH] Updated pin settings for new board --- Powercore-V2.0 Firmware/CC_Charger.c | 8 ++++---- Powercore-V2.0 Firmware/main.c | 2 +- Powercore-V2.0 Firmware/pulse_generator.c | 13 ++----------- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/Powercore-V2.0 Firmware/CC_Charger.c b/Powercore-V2.0 Firmware/CC_Charger.c index 4312ded..4360576 100644 --- a/Powercore-V2.0 Firmware/CC_Charger.c +++ b/Powercore-V2.0 Firmware/CC_Charger.c @@ -13,7 +13,7 @@ //CC_Charger Timing: #define CLK_PIN 6 #define LIMIT_PIN 9 -#define BLANKING_PIN 15 +#define BLANKING_PIN 13 //CC_Charger Control: #define CC_CHARGER_EN_PIN 5 @@ -25,11 +25,11 @@ #define GATE_BIAS_CLK_PIN 3 //PWM Voltage Sets: -#define CC_I_LIMIT_PIN 13 -#define V_CAP_SET_PIN 12 +#define CC_I_LIMIT_PIN 15 +#define V_CAP_SET_PIN 14 //Telemetry: -#define VSENSE_TRIP_PIN 11 +#define VSENSE_TRIP_PIN 12 PIO pio; diff --git a/Powercore-V2.0 Firmware/main.c b/Powercore-V2.0 Firmware/main.c index 460ccd5..fcbc472 100644 --- a/Powercore-V2.0 Firmware/main.c +++ b/Powercore-V2.0 Firmware/main.c @@ -12,7 +12,7 @@ //OUTPUT PULSE PARAMETERS (times in usecs) #define OUTPUT_ON_TIME 32 #define OUTPUT_OFF_TIME 512 -#define ISO_PULSE true +#define ISO_PULSE false #define CAP_VOLTAGE_SETPOINT 65 //CC Charger Parameters (don't change unless you know what you're doing) diff --git a/Powercore-V2.0 Firmware/pulse_generator.c b/Powercore-V2.0 Firmware/pulse_generator.c index d50024c..62f87a4 100644 --- a/Powercore-V2.0 Firmware/pulse_generator.c +++ b/Powercore-V2.0 Firmware/pulse_generator.c @@ -5,12 +5,10 @@ #include "hardware/adc.h" #define OUTPUT_EN_PIN 2 -#define OUTPUT_CURRENT_TRIP_PIN 10 -#define SPARK_THRESHOLD_PWM_PIN 14 +#define OUTPUT_CURRENT_TRIP_PIN 11 +#define SPARK_THRESHOLD_PWM_PIN 10 #define SHORT_ALERT_PIN 1 -#define PULSE_COUNTER_PWM_PIN 24 - #define CAP_VSENSE_PIN 27 #define SHORT_THRESHOLD 513 @@ -150,8 +148,6 @@ int64_t begin_off_time(alarm_id_t id, void *user_data){ gpio_put(SHORT_ALERT_PIN, true); } - pwm_set_gpio_level(PULSE_COUNTER_PWM_PIN, pulse_counter<<2); - return 0; } @@ -206,11 +202,6 @@ void pulse_generator_init(uint32_t trip_current) { pwm_set_enabled(pwm_gpio_to_slice_num(SPARK_THRESHOLD_PWM_PIN), true); - gpio_set_function(PULSE_COUNTER_PWM_PIN, GPIO_FUNC_PWM); - pwm_set_wrap(pwm_gpio_to_slice_num(PULSE_COUNTER_PWM_PIN), 2500); - - pwm_set_enabled(pwm_gpio_to_slice_num(PULSE_COUNTER_PWM_PIN), true); - gpio_add_raw_irq_handler(OUTPUT_CURRENT_TRIP_PIN, &output_current_trip_irq); adc_gpio_init(CAP_VSENSE_PIN);