Page 3 of 4

Re: DMX master has issues

Posted: Wed Jun 11, 2025 12:37 pm
by medelec35
Hello this error:
dmx887.c:143:1: error: (192) undefined identifier "OSCCON"
Is suggesting that OSCCON does not exist in code code you have change target to.
If you search Flowcode components (use the magnifying glass)
Search for intosc, then add the Intosc helper to your 2D panel ,it will show you the name of the register used to set the hardware speed.
It is not OSCCON!
Look at the properties of Intosc helper,you can copy and paste the correct register name and value within your project.

Martins project is using 16F887 which does has an OSCCON register, you just changed to a device which does not.

Re: DMX master has issues

Posted: Wed Jun 11, 2025 1:12 pm
by mnfisher
Just got a handful of 16f18877 arrive.

So far - nothing from the UART (although I can if I use the UART component - in software mode) - UART component doesn't go to 250000 baud - but (in theory) initialising the EUSART is straightforward.

So - as yet - nothing - but some more fiddling time later - and hopefully we'll have something working...

Re: DMX master has issues

Posted: Wed Jun 11, 2025 2:29 pm
by chipfryer27
Hi

Using the FC component I created a chart that:-

Flashes 3 times as Osc check
Sets start to 05 (random value chosen by me), data ch11 to 0b10101010 (170 decimal)
Loops sending this info every three seconds.

I connected to a logic analyser.

I expected to see a Mark after Break (MAB)
A start bit (low)
My Start Code
Two Stop Bits (high)
Then zero for all channels (with associated start and two stops) until ch11, then zero after until last channel

Not quite what I got

Screenshot 2025-06-11 142058.jpg
Screenshot 2025-06-11 142058.jpg (45.01 KiB) Viewed 111 times


You can see only one stop bit, the second isn't generated, and it without the second stop bit the frame is too short and the position of the subsequent stop bits are moving position within frame.

dmx1_init.fcfx
(12.76 KiB) Downloaded 5 times

I'm not an expert in DMX just going by documented protocol.
Hope this helps

Re: DMX master has issues

Posted: Wed Jun 11, 2025 5:53 pm
by mnfisher
Finally cracked it - I had the wrong value for RC6PPS.... I must have changed every other line of code!

A very simple demo - write DMX data to C6. Always uses a command byte of 0 (this might be better as data[0] or a parameter to SendDMXPacket)- if different values are needed. I just send 24 channels - though up to 512 is okay.

There are some bits that could be tidied

Please check it is actually valid DMX data :-)

Martin

Re: DMX master has issues

Posted: Wed Jun 11, 2025 6:40 pm
by chipfryer27
Hi

I can run through my analyser tomorrow morning and let you know.

Regards

Re: DMX master has issues

Posted: Wed Jun 11, 2025 8:41 pm
by beneee
Hi Martin,

Great news, I am getting a valid signal on my tester, here are the details it is giving me.

Ben
dmx_test1.png
dmx_test1.png (332.76 KiB) Viewed 85 times

Re: DMX master has issues

Posted: Wed Jun 11, 2025 9:27 pm
by beneee
Using the FC DMX component I can also get a valid signal as long as the outputted values don't change, when I added a simple macro that ramped the first 3 channels up and down at 3 different rates from 5 to 220 the fixture couldn't cope with the signal and the light flickered all over the place.
I am assuming the signal is just so corrupted the data is not where it is supposed to be.
Ben

Re: DMX master has issues

Posted: Wed Jun 11, 2025 9:31 pm
by beneee
Well here is the output generated by the DMX_Master component, do you think the 0us Inter Byte Gap is the issue - if so is there a method of requesting the higher Ups to edit the component?

Thanks
Ben
DMX_Master.png
DMX_Master.png (304.19 KiB) Viewed 79 times

Re: DMX master has issues

Posted: Wed Jun 11, 2025 9:33 pm
by beneee
DMX512.PNG
DMX512.PNG (364.55 KiB) Viewed 79 times

Re: DMX master has issues

Posted: Wed Jun 11, 2025 9:36 pm
by mnfisher
Looks promising.

I think there is a requirement for a minimum of 24 channels - and a maximum of 512.

I haven't added a set channel macro - though it would be easy to do.

Alternatively - in a calculation

Code: Select all

dmx_dat[channel_number 0..511] = value
We will be interested to hear how you get on... (with photos!)

Martin