PropBasic ws2811/2812 driver
EE351
Posts: 81
Hello all!
I'm a long time lurker, first time poster and I wanted to share the code I wrote in PropBasic to drive 50 ws2811 leds. Please keep in mind that I'm not a professional programmer by any stretch so I'm sure the code could use some refinement. Overall I'm very pleased with the speed of PropBasic, as the ws2811 signals generated by the prop are within spec according to my logic analyzer. Kudos to Bean for developing PropBasic!
My question is, would it be possible to use the serin command in PropBasic to receive data at 921600 baud? I would like to write some additional code that would receive e1.31 data from lighting software on a pc that would be received by the prop. The connection would be unidirectional, as data would only be sent from the PC to the prop via an rn-xv wifly device. The e1.31 packets would be 635 bytes long. I have experimented with transmitting bytes from the prop to hyperterminal at 921600 baud without issue, so I'll try sending data from the pc to the prop at the same baud rate. I'm just curious if anyone else has tried receiving large arrays of data at this speed using PropBasic.
I'm a long time lurker, first time poster and I wanted to share the code I wrote in PropBasic to drive 50 ws2811 leds. Please keep in mind that I'm not a professional programmer by any stretch so I'm sure the code could use some refinement. Overall I'm very pleased with the speed of PropBasic, as the ws2811 signals generated by the prop are within spec according to my logic analyzer. Kudos to Bean for developing PropBasic!
My question is, would it be possible to use the serin command in PropBasic to receive data at 921600 baud? I would like to write some additional code that would receive e1.31 data from lighting software on a pc that would be received by the prop. The connection would be unidirectional, as data would only be sent from the PC to the prop via an rn-xv wifly device. The e1.31 packets would be 635 bytes long. I have experimented with transmitting bytes from the prop to hyperterminal at 921600 baud without issue, so I'll try sending data from the pc to the prop at the same baud rate. I'm just curious if anyone else has tried receiving large arrays of data at this speed using PropBasic.
Comments
For critical timing tasks like these, I think you'd be wise to learn PASM or learn how to incorporate code written by others into your applications. When with compilers, there are some things that are best left to low-level code
I've attached my WS2811/12 driver (PASM with Spin interface), and high-speed RX (based on code from others) for your reference.
What part of my driver did you feel the need to modify? Just curious.
I changed the spin code that called your ws2812 driver (no changes were made to the driver itself). Specifically, I added a few new color routines to display different color outputs.
I think JonnyMac is right, I need to look into an assembly solution if I want to get this to work at 921600 baud.
Even unrolled, you may need to control byte-to-byte timing from your master program as the stop-bit(s) period may not be enough to write the new byte to your buffer and update the head pointer.
That is great news.
Could you post your working code ? I'd like to see it if you can.
At high baud rates it is not so much receiving the data, it doing something with it quickly so you can get back to receive the next bit in time.
Bean
Also I remember reading a forum post here about an IDE being developed specifically for Propbasic. Do you know if that project is still ongoing?