Difference: NeoPixel (2 vs. 3)

Revision 32021-04-10 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="MecrispCubeF405"

NeoPixel

Added:
>
>

Timing

 
Changed:
<
<
>
>

WS2812B Neopixel

 
T0H 0code, high voltage time 0.4us ±150ns
T1H 1code, high voltage time 0.8us ±150ns
Line: 11 to 13
 
T1L 1code, low voltage time 0.45us ±150ns
RES low voltage time Above 50μs
Added:
>
>
timing-neopixel.png
 
  • 1 bit takes 1.25 us, 24 bit take 30 us
  • Timer resolution 0.25 us
  • MSB first
Line: 18 to 23
  HTML Color 0xRRGGBB
Changed:
<
<

Set/Reset Portpin

>
>

F405

Cyclus = 1 / 168 MHz = 6 ns
Timer Resolution = 1 / 42 MHz = 23.8 ns

#define T0H		15	// 0.4 us, 0.4 us / 23.8 ns = 16.8
#define T1H		32	// 0.8 us, 33.6
#define T0L		34	// 0.85 us, 35.7
#define T1L		17	// 0.45 us, 18.9
#define TRES  	420	// 10 us, 420

WB55

Cyclus = 1 / 32 MHz = 31 ns
Timer Resolution =  1 / 32 MHz = 31 ns

Set/Reset Portpin

  GPIO port bit set/reset register GPIOx_BSRR
Changed:
<
<
  • Address offset: 0x18, x = A..K
>
>
  • Address offset: 0x18, x = A..K, D8 = PC0
 
  • bit0 .. bit15 bit set
  • bit16 .. bit31 bit reset
Changed:
<
<
D8 =
>
>
#define GPIOC_BASE            (AHB1PERIPH_BASE + 0x0800UL)
#define AHB1PERIPH_BASE       (PERIPH_BASE + 0x00020000UL)
#define PERIPH_BASE           0x40000000UL /*!< Peripheral base address in the alias region                                */

 
Changed:
<
<

Set Counter

>
>
GPIOC->BSRR
 
Deleted:
<
<

Set Time Period

 
Changed:
<
<
autoreload
>
>

Timer

 
Changed:
<
<

Clear Update Flag

>
>
TIM6
 
Changed:
<
<

Enable/Disable Timer Interrupt

>
>

Set Counter

 
Changed:
<
<

Start/Stop Timer

>
>
TIM6->CNT;
 
Added:
>
>

Set Time Period

 
Added:
>
>
TIM6->ARR; // autoreload
 
Added:
>
>

Clear Update Flag

TIM6->SR; // UIF update interrupt flag

Enable/Disable Timer Interrupt

TIM6->DIER; // UIE update interrupt enable

Start/Stop Timer

TIM6->CR1; // UDIS update disable, CEN counter enable

 
Deleted:
<
<
-- Peter Schmid - 2021-04-05
  • timing-neopixel.png:
    timing-neopixel.png
 
META FILEATTACHMENT attachment="timing-neopixel.png" attr="" comment="" date="1617633491" name="timing-neopixel.png" path="timing-neopixel.png" size="19590" user="PeterSchmid" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback