Hi,
I intitialized PWM1 instance:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
nrf_drv_pwm_config_t const config1 =
{
.output_pins = {
2, // channel 0
31, // channel 1
27, // channel 2
NRF_DRV_PWM_PIN_NOT_USED, // channel 3
},
.irq_priority = APP_IRQ_PRIORITY_LOWEST,
.base_clock = NRF_PWM_CLK_125kHz,
.count_mode = NRF_PWM_MODE_UP,
.top_value = 100,
.load_mode = NRF_PWM_LOAD_INDIVIDUAL,
.step_mode = NRF_PWM_STEP_AUTO
};
APP_ERROR_CHECK(nrf_drv_pwm_init(&m_pwm1, &config1, NULL));
I use PWM1 to generate constant PWM signal with nrf_drv_pwm_simple_playback(m_pwm1, &seq, 1, NRF_DRV_PWM_FLAG_LOOP);
I also initialized SPI0 (I really don't use MOSI and SCK pins of SPI):
Fullscreen
1
2
3
4
5
6
7
8
9
10
nrfx_spim_xfer_desc_t xfer_desc = NRFX_SPIM_XFER_TRX(&tx, 1, &rx0, 1);
nrfx_spim_config_t spi_config = NRFX_SPIM_DEFAULT_CONFIG;
spi_config.frequency = NRF_SPIM_FREQ_8M;
spi_config.miso_pin = 26;
spi_config.mosi_pin = NRFX_SPIM_PIN_NOT_USED;
spi_config.sck_pin = NRFX_SPIM_PIN_NOT_USED;
APP_ERROR_CHECK(nrfx_spim_init(&spi0, &spi_config, spim0_event_handler, NULL));
APP_ERROR_CHECK(nrfx_spim_xfer(&spi0, &xfer_desc, NRFX_SPIM_FLAG_HOLD_XFER));
This way PWM1.channel1 doesn't work, no PWM is present.
If I change initialization of SPI0:
spi_config.sck_pin = 0xFE; // anything other than 0xFF
than PWM1.channel1 works as expected.
Any idea why is this happening?