DMX master has issues

For general Flowcode discussion that does not belong in the other sections.
mnfisher
Valued Contributor
Posts: 1512
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 138 times
Been thanked: 725 times

Re: DMX master has issues

Post by mnfisher »

:-(

How did you do the 'heartbeat' pulse - with an interrupt or in the main loop. If the UART isn't quite initialised correctly then the wait for transmission to finish - may never return.

I did get output with the FC component - but that was with a PIC32 and checking the output on the oscilloscope - the UART decoder didn't make great sense of the values sent...

Martin

chipfryer27
Valued Contributor
Posts: 1574
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 356 times
Been thanked: 560 times

Re: DMX master has issues

Post by chipfryer27 »

Hi

As per the chart, straight after setting the oscillator I pulsed the heartbeat, then held the pin high after DMX initialising. As the pin goes high, then we returned from initialising.

Regards

chipfryer27
Valued Contributor
Posts: 1574
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 356 times
Been thanked: 560 times

Re: DMX master has issues

Post by chipfryer27 »

Hi

I replaced Martin's "initialisation" with the FC component.

I then got a trace on C7 (hardware pin).

Screenshot 2025-06-07 104733.jpg
Screenshot 2025-06-07 104733.jpg (54.67 KiB) Viewed 125 times

However I notice in the decoded results that there is a warning that the MAB is too short (Mark After Break). I would need to read up on DMX protocol but this could possibly be accounting for the errors, as perhaps it is knocking timings out?

I've not went further but may get a chance to look further later.

Regards

mnfisher
Valued Contributor
Posts: 1512
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 138 times
Been thanked: 725 times

Re: DMX master has issues

Post by mnfisher »

Whilst waiting for a 16F18877 to arrive in the post - I tried a different MCU.

So with a PIC16F887 (which is rather a lower specced beast) - I got a simple DMX output running (I think)

Here outputting 24 channels (set to 0..23) My logic analyser reads the 'start' pulse as 0.
I'm using '0' as the control byte too (this could be set as data[0] or passed as a parameter depending on requirements but at present SendDMXPacket has it hardcoded as 0.
LabNation_Screenshot33.png
LabNation_Screenshot33.png (187.13 KiB) Viewed 125 times
This is with the MCU running at 8MHz

Martin
Attachments
dmx887.fcfx
(13.7 KiB) Downloaded 6 times

mnfisher
Valued Contributor
Posts: 1512
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 138 times
Been thanked: 725 times

Re: DMX master has issues

Post by mnfisher »

While I was typing - Iain popped in with a test of the DMX component too. I don't have a way to test if it is a valid DMX signal - how doing?

chipfryer27
Valued Contributor
Posts: 1574
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 356 times
Been thanked: 560 times

Re: DMX master has issues

Post by chipfryer27 »

Hi

I was running on a 18877 @ 32MHz

From memory you don't need a reply from your DMX receiver (I could be wrong) so in theory a decoder built into your scope/analyser may help, but of course any actual DMX receiver would be best.

Regards

chipfryer27
Valued Contributor
Posts: 1574
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 356 times
Been thanked: 560 times

Re: DMX master has issues

Post by chipfryer27 »

Hi

Further to above, I haven't looked at the component but would it be possible to increase the MAB from the current 2.06uS ?

From the web it suggests it should be 8uS but who knows how accurate that source is?

Regards

mnfisher
Valued Contributor
Posts: 1512
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 138 times
Been thanked: 725 times

Re: DMX master has issues

Post by mnfisher »

Just using the UART decoder at present. Just checking if sigrok will do the trick...

beneee
Posts: 16
Joined: Tue Jul 13, 2021 2:02 pm
Has thanked: 1 time

Re: DMX master has issues

Post by beneee »

I have tried running Martins file on my 18877 setup to see if the output is a valid DMX signal however it won't compile to target.

Thanks
Ben

This is the error:
G:\My Drive\Moonwalk\Moonwalk 2025\DMX Pic>"C:\Program Files (x86)\Flowcode\Common\Compilers\picv2\bin\xc8-cc.exe" -mcpu=16F18877 "dmx887.c" -w=359,1273,1388 -fno-short-float -fno-short-double -std=c90 -Os
dmx887.c:143:1: error: (192) undefined identifier "OSCCON"
(908) exit status = 1

Error returned from [xc8.exe]

C:\ProgramData\MatrixTSL\FlowcodeV10\FCD\PIC\batch\pic_xc8_comp.bat reported error code 0x1

chipfryer27
Valued Contributor
Posts: 1574
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 356 times
Been thanked: 560 times

Re: DMX master has issues

Post by chipfryer27 »

Hi

I could download it to a 18877 without issue, but when run my decoder informs that the MAB is to short (being 2.06uS).

This may be a typo in the component. Perhaps Matrix could check?

Regards

Post Reply