cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Anonymous
Not applicable

Hi,

I would like to send a 24bit serial data using assembly code but I am not experienced in assembly at all. Can anyone help me on this? If there are any resources about data transfer in assembly like application notes or something please share with me.

By the way let me give some more detail about what I am trying to do. Basically I want to drive WS2812B RGB LEDs and as you may know they require strict timing for sending bits. I actually implemented a code in C, which using CyPins_SetPin() and Pin_Write() builtin functions but using them is not a good way to solve the issue I guess. Therefore I would like to implement this in Assembly language putting some "nop"s for the delay required sending bits.

So I am in need of all kinds of help,

Thanks in advance!

0 Likes
1 Solution
6 Replies
HeLi_263931
Honored Contributor II

Why don't you use the SPI component? It will be much more efficient, and requires less code.

0 Likes
Anonymous
Not applicable

The timing diagram of the LEDs is as follows,

pastedImage_0.png

pastedImage_2.png

Am I able to implement these timings with SPI? In SPI the frequency is fixed I guess.

0 Likes
HeLi_263931
Honored Contributor II

Ah, I forgot that these sort of LEDs have a strange interface. I guess you either

  • use two timer components (maybe together with the SPI)
  • or configure the SPI so that the difference between T0H and T0L matches one clock frame - 250ns (4MHz) should work. You need to prepare your data then properly though (0->1000, 1->1110)
0 Likes
HeLi_263931
Honored Contributor II

Apart from that - there are Cypress AppNotes regarding assembler programming with the PSoC.

0 Likes
HolgerW_56
Employee

Have you already seen this:

NeoPixel (WS2811/12) component

Regards,

Holger

0 Likes