Send 24 bit data with Assembly implementation in PSoC 4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
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
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

This appnote will be helpful. <http://www.cypress.com/file/46521/download >

Best Regards,
VSRS

View solution in original post

0 Likes
6 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

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

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

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

0 Likes
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked

Hi,

This appnote will be helpful. <http://www.cypress.com/file/46521/download >

Best Regards,
VSRS

0 Likes

Have you already seen this:

NeoPixel (WS2811/12) component

Regards,

Holger

0 Likes