DMX512 Transmit and Receive?

Status
Not open for further replies.

jkoffman

Well-known member
Hi all,

I am new to the Teensy, so please excuse my ignorance.

I am considering a application where I want to both transmit and receive DMX at the same time. Not the same data though. In a previous project on another micro, I did this using a single UART, and it worked great. This is my first Teensy project, and actually my first time using C to do this. I believe it should work...but I wanted to check.

So, questions:

1. Is is possible to transmit and receive different things simultaneously on the same UART on the Teensy?
2. Does anyone know of either a single DMX RX/TX library that would allow this natively, or separate RX and TX libraries that wouldn't mind that the other half of the UART is working?

Thank you!
 
1. Is is possible to transmit and receive different things simultaneously on the same UART on the Teensy?

Yes.

2. Does anyone know of either a single DMX RX/TX library that would allow this natively, or separate RX and TX libraries that wouldn't mind that the other half of the UART is working?

That's a bit trickier, especially if you transmit the start-of-frame break by lowering the baud rate.

An easier plan would be to use Serial1 to receive and Serial2 to transmit.
 
That's a bit trickier, especially if you transmit the start-of-frame break by lowering the baud rate.

An easier plan would be to use Serial1 to receive and Serial2 to transmit.

Hi Paul,

Thanks for the reply (and the cool products!).

Ok, gotcha. On my other micro I managed the break by putting the transmitter into standby, which then let me manipulate the line directly.

I think for this project I'll stick to using two separate ports. I was trying to economize on pins, but making things too complex for my first Teensy project is probably not a great idea.

Any suggestions for DMX libraries that use the UART? I'm looking at Ward's (link: http://forum.pjrc.com/threads/19662...re-functionality?p=24993&viewfull=1#post24993 ). I'm not sure if there have been any updates though. Still searching...

Thanks!
 
As far as I know, Ward's code is still the best for receiving.

Transmitting is pretty simple, but you might want to edit serial1.c to increase the buffer size to 514 or more.
 
As far as I know, Ward's code is still the best for receiving.

Transmitting is pretty simple, but you might want to edit serial1.c to increase the buffer size to 514 or more.

Awesome, thank you for the info.

I'm trying to do this first project using libraries that already work since I am so unfamiliar with the hardware. I grew up an assembly programmer, so switching to C has been a bit of an adventure as well. Hence the search for libraries that already are known to receive and transmit DMX. It's a hardware protocol I understand, so I'm hoping looking through those libraries will help me to get a better understanding of how the processor works.

I have a few other questions, but I'll start a new thread as they're a bit more general hardware in nature.
 
Hey jkoffman,

Pretty new to teensy, but working my way around using some existing libraries to get myself clued up.

I've got an idea for a project that I'd like to receive and transmit DMX at the same time, did you get any further with your project?
If you have any advice, would be much appreciated.
 
I have an open source project, TeensyDMX, that should do what you need. For simultaneous transmit and receive, you currently need to use two serial ports.
 
Hey jkoffman,

Pretty new to teensy, but working my way around using some existing libraries to get myself clued up.

I've got an idea for a project that I'd like to receive and transmit DMX at the same time, did you get any further with your project?
If you have any advice, would be much appreciated.

Welcome to the club! Apologies for the late reply. Shawn's library is great, and a new version is coming soon too!
 
Status
Not open for further replies.
Back
Top