Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase RPi Pico PWM range and resolution to the max supported by HW #203

Merged
merged 4 commits into from Jan 16, 2024

Conversation

multiplemonomials
Copy link
Collaborator

@multiplemonomials multiplemonomials commented Jan 6, 2024

Summary of changes

@Olivier_Corrio on the Mbed forums reported an issue with the PWM functionality on RPi Pico. After some investigation, I confirmed the issue: The initial implementation of PWM always uses a top_count of 1000 and only varies the divider to set the PWM period. I think they did it this way to avoid floating point math, but it is sub-optimalfor three reasons:

  • Low duty cycle resolution of the PWM -- only 1/1000 increments when it could be 1/65536 increments
  • High minimum PWM period -- with a divider of 1 and a top_count of 1000, the minimum PWM period is 8us, even though the hardware supports sub 1us periods (with top_count lower than 1000)
  • Low maximum PWM period -- with a divider of 256 and a top_count of 1000, the maximum PWM period is 2.05ms, even though the hardware supports up to 134ms periods (with top_count = 65535)

This PR redesigns the math that sets the PWM period so that both the divider and the top_count are calculated dynamically in order to match the requested period as closely as possible. It does mean that setting the PWM period will be a tad more performance intensive, but this isn't an operation done commonly at runtime, and the benefits to range and accuracy are significant, so I think we should be OK!

Bonus: I also fixed a bug where the RPi Pico HAL was returning values in the range [0, 3.3] instead of [0, 1] from the ADC. This means that AnalogIn::read() now matches the spec behavior.

Impact of changes

Improved range and accuracy of PWM for RPi Pico

Migration actions required

None

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

I ran my new (create just for this!) PWM and ADC test shield test on the new implementation, and it passed!

8: Executing: C:/Program Files/Python311/python.exe -m mbed_host_tests.mbedhtrun --skip-flashing -p COM10 --skip-reset -e C:/Users/jamie/Documents/RPL/Mbed-CI-Test-Shield/Software/host_tests -m RASPBERRY_PI_PICO_SWD --baud-rate=115200
8: [1705309102.38][HTST][INF] host test executor ver. 0.0.16
8: [1705309102.38][HTST][INF] copy image onto target... SKIPPED!
8: [1705309102.40][HTST][INF] starting host test process...
8: [1705309103.71][CONN][INF] starting connection process...
8: [1705309103.71][CONN][INF] notify event queue about extra 60 sec timeout for serial port pooling
8: [1705309103.71][CONN][INF] initializing serial port listener...
8: [1705309103.71][SERI][INF] using specified port 'COM10'
8: [1705309103.71][HTST][INF] setting timeout to: 60 sec
8: [1705309103.71][SERI][INF] serial(port=COM10, baudrate=115200, read_timeout=0.01, write_timeout=5)
8: [1705309103.71][SERI][TXD] mbedmbedmbedmbedmbedmbedmbedmbedmbedmbed
8: [1705309103.71][CONN][INF] sending up to 2 __sync packets (specified with --sync=2)
8: [1705309103.71][CONN][INF] sending preamble 'd0210a0a-3a70-45e6-8ba2-68ecaad3325d'
8: [1705309103.71][SERI][TXD] {{__sync;d0210a0a-3a70-45e6-8ba2-68ecaad3325d}}
8: [1705309103.74][CONN][RXD] mbedmbedmbedmbedmbedmbedmbedmbed
8: [1705309103.74][CONN][INF] found SYNC in stream: {{__sync;d0210a0a-3a70-45e6-8ba2-68ecaad3325d}} it is #0 sent, queued...
8: [1705309103.74][CONN][INF] found KV pair in stream: {{__version;1.3.0}}, queued...
8: [1705309103.74][CONN][INF] found KV pair in stream: {{__timeout;60}}, queued...
8: [1705309103.74][HTST][INF] sync KV found, uuid=d0210a0a-3a70-45e6-8ba2-68ecaad3325d, timestamp=1705309103.742140
8: [1705309103.74][HTST][INF] DUT greentea-client version: 1.3.0
8: [1705309103.74][HTST][INF] setting timeout to: 60 sec
8: [1705309103.75][CONN][RXD] >>> Running 7 test cases...
8: [1705309103.75][CONN][INF] found KV pair in stream: {{__host_test_name;signal_analyzer_test}}, queued...
8: [1705309103.75][CONN][INF] found KV pair in stream: {{__testcase_name;Test reading digital values with the ADC}}, queued...
8: [1705309103.76][HTST][INF] host test class: '<class 'signal_analyzer_test.SignalAnalyzerHostTest'>'
8: [1705309103.76][TEST][INF] Signal Analyzer Test host test setup complete.
8: [1705309103.76][HTST][INF] host test setup() call...
8: [1705309103.76][HTST][INF] CALLBACKs updated
8: [1705309103.76][HTST][INF] host test detected: signal_analyzer_test
8: [1705309103.77][CONN][INF] found KV pair in stream: {{__testcase_name;Test reading analog values with the ADC}}, queued...
8: [1705309103.77][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 50 Hz)}}, queued...
8: [1705309103.78][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 1 kHz)}}, queued...
8: [1705309103.78][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 10 kHz)}}, queued...
8: [1705309103.79][CONN][RXD] 
8: [1705309103.79][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 100 kHz)}}, queued...
8: [1705309103.79][CONN][INF] found KV pair in stream: {{__testcase_name;Test PWM frequency and duty cycle (freq = 1 MHz)}}, queued...
8: [1705309103.80][CONN][RXD] >>> Running case #1: 'Test reading digital values with the ADC'...
8: [1705309103.80][CONN][INF] found KV pair in stream: {{__testcase_start;Test reading digital values with the ADC}}, queued...
8: [1705309103.83][CONN][RXD] With the PWM at full off, the ADC reads 0.4% of reference voltage.
8: [1705309103.89][CONN][RXD] With the PWM at full on, the ADC reads 100.0% of reference voltage.
8: [1705309103.89][CONN][INF] found KV pair in stream: {{__testcase_finish;Test reading digital values with the ADC;1;0}}, queued...
8: [1705309103.90][CONN][RXD] >>> 'Test reading digital values with the ADC': 1 passed, 0 failed
8: [1705309103.90][CONN][RXD] <greentea test suite>:0::PASS
8: [1705309103.91][CONN][RXD] Based on target.default-adc-vref of 3.30V, the digital IO voltage of this target is 3.30V.
8: [1705309103.91][CONN][RXD] >>> Running case #2: 'Test reading analog values with the ADC'...
8: [1705309103.92][CONN][INF] found KV pair in stream: {{__testcase_start;Test reading analog values with the ADC}}, queued...
8: [1705309103.96][CONN][RXD] PWM duty cycle of 0.0% produced an ADC reading of 0.6% (expected 0.0%)
8: [1705309104.01][CONN][RXD] PWM duty cycle of 10.0% produced an ADC reading of 10.6% (expected 10.0%)
8: [1705309104.05][CONN][RXD] PWM duty cycle of 20.0% produced an ADC reading of 20.8% (expected 20.0%)
8: [1705309104.11][CONN][RXD] PWM duty cycle of 30.0% produced an ADC reading of 31.2% (expected 30.0%)
8: [1705309104.16][CONN][RXD] PWM duty cycle of 40.0% produced an ADC reading of 40.8% (expected 40.0%)
8: [1705309104.20][CONN][RXD] PWM duty cycle of 50.0% produced an ADC reading of 50.7% (expected 50.0%)
8: [1705309104.26][CONN][RXD] PWM duty cycle of 60.0% produced an ADC reading of 60.6% (expected 60.0%)
8: [1705309104.30][CONN][RXD] PWM duty cycle of 70.0% produced an ADC reading of 70.5% (expected 70.0%)
8: [1705309104.36][CONN][RXD] PWM duty cycle of 80.0% produced an ADC reading of 80.5% (expected 80.0%)
8: [1705309104.41][CONN][RXD] PWM duty cycle of 90.0% produced an ADC reading of 90.6% (expected 90.0%)
8: [1705309104.41][CONN][INF] found KV pair in stream: {{__testcase_finish;Test reading analog values with the ADC;1;0}}, queued...
8: [1705309104.42][CONN][RXD] >>> 'Test reading analog values with the ADC': 1 passed, 0 failed
8: [1705309104.42][CONN][RXD] <greentea test suite>:0::PASS
8: [1705309104.42][CONN][RXD]
8: [1705309104.43][CONN][RXD] >>> Running case #3: 'Test PWM frequency and duty cycle (freq = 50 Hz)'...
8: [1705309104.43][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 50 Hz)}}, queued...
8: [1705309104.43][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309105.58][SERI][TXD] {{frequency;50.0}}
8: [1705309105.59][SERI][TXD] {{duty_cycle;0.05318486703783241}}
8: [1705309105.61][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 5.32% (+-0.10%), host measured frequency 50 Hz and duty cycle 5.32%
8: [1705309105.61][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309106.75][SERI][TXD] {{frequency;50.0}}
8: [1705309106.76][SERI][TXD] {{duty_cycle;0.1601120997197507}}
8: [1705309106.78][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 16.01% (+-0.10%), host measured frequency 50 Hz and duty cycle 16.01%
8: [1705309106.78][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309107.93][SERI][TXD] {{frequency;50.0}}
8: [1705309107.94][SERI][TXD] {{duty_cycle;0.6614133464666339}}
8: [1705309107.96][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 66.14% (+-0.10%), host measured frequency 50 Hz and duty cycle 66.14%
8: [1705309107.96][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309109.09][SERI][TXD] {{frequency;50.0}}
8: [1705309109.10][SERI][TXD] {{duty_cycle;0.8503653740865648}}
8: [1705309109.13][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 85.04% (+-0.10%), host measured frequency 50 Hz and duty cycle 85.04%
8: [1705309109.13][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309110.26][SERI][TXD] {{frequency;50.0}}
8: [1705309110.27][SERI][TXD] {{duty_cycle;0.6394659013352466}}
8: [1705309110.29][CONN][RXD] Expected PWM frequency was 50 Hz (+- 20 Hz) and duty cycle was 63.95% (+-0.10%), host measured frequency 50 Hz and duty cycle 63.95%
8: [1705309110.30][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 50 Hz)': 1 passed, 0 failed
8: [1705309110.30][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 50 Hz);1;0}}, queued...
8: [1705309110.31][CONN][RXD] <greentea test suite>:0::PASS
8: [1705309110.31][CONN][RXD]
8: [1705309110.31][CONN][RXD] >>> Running case #4: 'Test PWM frequency and duty cycle (freq = 1 kHz)'...
8: [1705309110.32][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 1 kHz)}}, queued...
8: [1705309110.32][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309111.47][SERI][TXD] {{frequency;1000.0}}
8: [1705309111.48][SERI][TXD] {{duty_cycle;0.6189334526663683}}
8: [1705309111.50][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 20 Hz) and duty cycle was 61.89% (+-0.10%), host measured frequency 1000 Hz and duty cycle 61.89%
8: [1705309111.50][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309112.63][SERI][TXD] {{frequency;1000.0}}
8: [1705309112.64][SERI][TXD] {{duty_cycle;0.4149539626150935}}
8: [1705309112.67][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 20 Hz) and duty cycle was 41.49% (+-0.10%), host measured frequency 1000 Hz and duty cycle 41.50%
8: [1705309112.67][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309113.81][SERI][TXD] {{frequency;1000.0}}
8: [1705309113.82][SERI][TXD] {{duty_cycle;0.7679805800485499}}
8: [1705309113.84][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 20 Hz) and duty cycle was 76.80% (+-0.10%), host measured frequency 1000 Hz and duty cycle 76.80%
8: [1705309113.84][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309114.99][SERI][TXD] {{frequency;1000.0}}
8: [1705309115.00][SERI][TXD] {{duty_cycle;0.9825100437248907}}
8: [1705309115.02][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 20 Hz) and duty cycle was 98.25% (+-0.10%), host measured frequency 1000 Hz and duty cycle 98.25%
8: [1705309115.02][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309116.15][SERI][TXD] {{frequency;1000.0}}
8: [1705309116.16][SERI][TXD] {{duty_cycle;0.4871312821717946}}
8: [1705309116.18][CONN][RXD] Expected PWM frequency was 1000 Hz (+- 20 Hz) and duty cycle was 48.71% (+-0.10%), host measured frequency 1000 Hz and duty cycle 48.71%
8: [1705309116.19][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 1 kHz)': 1 passed, 0 failed
8: [1705309116.19][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 1 kHz);1;0}}, queued...
8: [1705309116.20][CONN][RXD] <greentea test suite>:0::PASS
8: [1705309116.20][CONN][RXD]
8: [1705309116.20][CONN][RXD] >>> Running case #5: 'Test PWM frequency and duty cycle (freq = 10 kHz)'...
8: [1705309116.22][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 10 kHz)}}, queued...
8: [1705309116.22][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309117.36][SERI][TXD] {{frequency;10000.0}}
8: [1705309117.37][SERI][TXD] {{duty_cycle;0.7961130097174757}}
8: [1705309117.39][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 20 Hz) and duty cycle was 79.60% (+-0.10%), host measured frequency 10000 Hz and duty cycle 79.61%
8: [1705309117.39][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309118.54][SERI][TXD] {{frequency;10000.0}}
8: [1705309118.55][SERI][TXD] {{duty_cycle;0.9695325761685596}}
8: [1705309118.57][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 20 Hz) and duty cycle was 96.95% (+-0.10%), host measured frequency 10000 Hz and duty cycle 96.95%
8: [1705309118.57][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309119.71][SERI][TXD] {{frequency;10000.0}}
8: [1705309119.72][SERI][TXD] {{duty_cycle;0.24595438511403722}}
8: [1705309119.75][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 20 Hz) and duty cycle was 24.59% (+-0.10%), host measured frequency 10000 Hz and duty cycle 24.60%
8: [1705309119.75][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309120.87][SERI][TXD] {{frequency;10000.0}}
8: [1705309120.88][SERI][TXD] {{duty_cycle;0.8313079217301956}}
8: [1705309120.90][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 20 Hz) and duty cycle was 83.13% (+-0.10%), host measured frequency 10000 Hz and duty cycle 83.13%
8: [1705309120.90][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309122.05][SERI][TXD] {{frequency;10000.0}}
8: [1705309122.06][SERI][TXD] {{duty_cycle;0.2927892680268299}}
8: [1705309122.08][CONN][RXD] Expected PWM frequency was 10000 Hz (+- 20 Hz) and duty cycle was 29.28% (+-0.10%), host measured frequency 10000 Hz and duty cycle 29.28%
8: [1705309122.10][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 10 kHz)': 1 passed, 0 failed
8: [1705309122.10][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 10 kHz);1;0}}, queued...
8: [1705309122.11][CONN][RXD] <greentea test suite>:0::PASS
8: [1705309122.11][CONN][RXD]
8: [1705309122.11][CONN][RXD] >>> Running case #6: 'Test PWM frequency and duty cycle (freq = 100 kHz)'...
8: [1705309122.12][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 100 kHz)}}, queued...
8: [1705309122.12][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309123.26][SERI][TXD] {{frequency;100000.0}}
8: [1705309123.27][SERI][TXD] {{duty_cycle;0.34882412793968015}}
8: [1705309123.29][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 20 Hz) and duty cycle was 34.90% (+-1.00%), host measured frequency 100000 Hz and duty cycle 34.88%
8: [1705309123.29][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309124.43][SERI][TXD] {{frequency;100000.0}}
8: [1705309124.44][SERI][TXD] {{duty_cycle;0.2216819457951355}}
8: [1705309124.46][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 20 Hz) and duty cycle was 22.19% (+-1.00%), host measured frequency 100000 Hz and duty cycle 22.17%
8: [1705309124.46][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309125.59][SERI][TXD] {{frequency;100000.0}}
8: [1705309125.61][SERI][TXD] {{duty_cycle;0.6310709223226942}}
8: [1705309125.63][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 20 Hz) and duty cycle was 63.09% (+-1.00%), host measured frequency 100000 Hz and duty cycle 63.11%
8: [1705309125.63][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309126.76][SERI][TXD] {{frequency;100000.0}}
8: [1705309126.77][SERI][TXD] {{duty_cycle;0.8138579653550866}}
8: [1705309126.79][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 20 Hz) and duty cycle was 81.33% (+-1.00%), host measured frequency 100000 Hz and duty cycle 81.39%
8: [1705309126.79][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309127.94][SERI][TXD] {{frequency;100000.0}}
8: [1705309127.95][SERI][TXD] {{duty_cycle;0.49530376174059565}}
8: [1705309127.97][CONN][RXD] Expected PWM frequency was 100000 Hz (+- 20 Hz) and duty cycle was 49.56% (+-1.00%), host measured frequency 100000 Hz and duty cycle 49.53%
8: [1705309127.98][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 100 kHz)': 1 passed, 0 failed
8: [1705309127.98][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 100 kHz);1;0}}, queued...
8: [1705309127.99][CONN][RXD] <greentea test suite>:0::PASS
8: [1705309127.99][CONN][RXD]
8: [1705309127.99][CONN][RXD] >>> Running case #7: 'Test PWM frequency and duty cycle (freq = 1 MHz)'...
8: [1705309128.00][CONN][INF] found KV pair in stream: {{__testcase_start;Test PWM frequency and duty cycle (freq = 1 MHz)}}, queued...
8: [1705309128.00][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309129.15][SERI][TXD] {{frequency;1000000.0}}
8: [1705309129.16][SERI][TXD] {{duty_cycle;0.3157117107207232}}
8: [1705309129.18][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 20 Hz) and duty cycle was 30.80% (+-10.00%), host measured frequency 1000000 Hz and duty cycle 31.57%
8: [1705309129.18][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309130.31][SERI][TXD] {{frequency;1000000.0}}
8: [1705309130.32][SERI][TXD] {{duty_cycle;0.4726613183467041}}
8: [1705309130.34][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 20 Hz) and duty cycle was 46.96% (+-10.00%), host measured frequency 1000000 Hz and duty cycle 47.27%
8: [1705309130.34][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309131.50][SERI][TXD] {{frequency;1000000.0}}
8: [1705309131.51][SERI][TXD] {{duty_cycle;0.3469966325084187}}
8: [1705309131.53][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 20 Hz) and duty cycle was 34.13% (+-10.00%), host measured frequency 1000000 Hz and duty cycle 34.70%
8: [1705309131.53][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309132.66][SERI][TXD] {{frequency;1000000.0}}
8: [1705309132.68][SERI][TXD] {{duty_cycle;0.35482411293971766}}
8: [1705309132.70][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 20 Hz) and duty cycle was 35.34% (+-10.00%), host measured frequency 1000000 Hz and duty cycle 35.48%
8: [1705309132.70][CONN][INF] found KV pair in stream: {{analyze_signal;please}}, queued...
8: [1705309133.83][SERI][TXD] {{frequency;1000010.0}}
8: [1705309133.84][SERI][TXD] {{duty_cycle;0.4447688880777798}}
8: [1705309133.86][CONN][RXD] Expected PWM frequency was 1000000 Hz (+- 20 Hz) and duty cycle was 44.74% (+-10.00%), host measured frequency 1000010 Hz and duty cycle 44.48%
8: [1705309133.87][CONN][RXD] >>> 'Test PWM frequency and duty cycle (freq = 1 MHz)': 1 passed, 0 failed
8: [1705309133.87][CONN][INF] found KV pair in stream: {{__testcase_finish;Test PWM frequency and duty cycle (freq = 1 MHz);1;0}}, queued...
8: [1705309133.89][CONN][RXD] <greentea test suite>:0::PASS
8: [1705309133.89][CONN][RXD]
8: [1705309133.89][CONN][RXD] >>> Test cases: 7 passed, 0 failed
8: [1705309133.89][CONN][RXD]
8: [1705309133.89][CONN][RXD] -----------------------
8: [1705309133.89][CONN][RXD] 0 Tests 0 Failures 0 Ignored
8: [1705309133.89][CONN][RXD] OK
8: [1705309133.89][CONN][INF] found KV pair in stream: {{__testcase_summary;7;0}}, queued...
8: [1705309133.89][CONN][INF] found KV pair in stream: {{end;success}}, queued...
8: [1705309133.89][CONN][INF] found KV pair in stream: {{__exit;0}}, queued...
8: [1705309133.89][HTST][INF] __exit(0)
8: [1705309133.89][HTST][INF] __notify_complete(True)
8: [1705309133.89][HTST][INF] __exit_event_queue received
8: [1705309133.89][HTST][INF] test suite run finished after 30.15 sec...
8: [1705309133.91][CONN][INF] received special event '__host_test_finished' value='True', finishing
8: [1705309134.02][HTST][INF] CONN exited with code: 0
8: [1705309134.03][HTST][INF] Some events in queue
8: [1705309134.03][HTST][INF] stopped consuming events
8: [1705309134.03][HTST][INF] host test result() call skipped, received: True
8: [1705309134.03][HTST][INF] calling blocking teardown()
8: [1705309134.03][HTST][INF] teardown() finished
8: [1705309134.03][HTST][INF] {{result;success}}
1/1 Test #8: test-testshield-pwm-and-adc ......   Passed   48.30 sec

The following tests passed:
        test-testshield-pwm-and-adc

100% tests passed, 0 tests failed out of 1


Reviewers


@multiplemonomials multiplemonomials changed the title [draft] Attempt to increase RPi Pico PWM range and resolution to the max supported Attempt to increase RPi Pico PWM range and resolution to the max supported Jan 15, 2024
@multiplemonomials multiplemonomials changed the title Attempt to increase RPi Pico PWM range and resolution to the max supported Increase RPi Pico PWM range and resolution to the max supported by HW Jan 15, 2024
platform/mbed_lib.json Outdated Show resolved Hide resolved
@multiplemonomials multiplemonomials merged commit 73b0306 into master Jan 16, 2024
9 checks passed
@multiplemonomials multiplemonomials deleted the dev/rpi-pico-full-pwm-support branch January 16, 2024 16:34
@archqt
Copy link

archqt commented Apr 24, 2024

Do you know when platformIO will update their mbed version with this patch ? It doesn't work for now with the mbed version provided with platformIO. Thanks

@multiplemonomials
Copy link
Collaborator Author

Sadly I don't think PlatformIO supports the mbed-ce fork :/

@archqt
Copy link

archqt commented Apr 24, 2024

Sadly I don't think PlatformIO supports the mbed-ce fork :/

Thanks, i posted on platformIO issues, we will see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants