Hi -
From what I can tell, you've copied the code I posted a few months ago verbatim. And I know that the code is good.
What I posted was a *subroutine* which checks for DMX at a particular address.
But, if what you've posted is in fact your entire project, it seems that you haven't added anything to it all!
RCIF needs to be defined as whichever bit of the PIR register it actually is. Without it being defined, you code may return strange results. PIR1.5? Check your datasheet.
The PULSIN routine in my code looks for DMX on PORTB.1, which is the RX pin for the processor I used. Your first post from a few days ago mentions that you're hoping to receive on PORTC.7. But you haven't changed the PULSIN command to suit, so there's no chance it will work right out of the box.
You're using a different oscillator than I did. Have you confirmed that SPBRG and BRGH have the same values?
How do you know you're even finding the break signal? Have you added any flags or pin-twiddles which let you know where the program is at any given time?
One thing I did when I started writing the code was to insert something like this:
If break signal was received
high PORTB.FOO
pauseus 10
low PORTB.FOO
endif
Then, I could monitor the incoming signal and the FOO pin at the same time on my 'scope. Once I saw the FOO pin pulsing at exactly the proper position, I moved on to decoding other parts of the DMX stream. But if you don't catch the break signal properly, you don't have a chance at getting the rest of the stream.
There are so many inconsistencies here that it's hard to know where to start...
John




Bookmarks