magicmarty
- 20th September 2004, 03:09
Hi All,
I'm trying to make a small DMX (lighting) test box, and i was going to create the dmx signal by using a combination of "pulsout" and "pauseus" commands to meet the timing standard of DMX.
My problem is that my pic 'F877 running at 20Mhz has some form of of delay between my commands.
I completely stripped my code down, and experimented wiht only the folling snippet of code :
************************************************** *
INCLUDE "modedefs.bas"
DEFINE OSC 20
dmxdata VAR PORTA.0 'variable dmx to portA bit0.
TRISA=0 'set port A as OUTPUTS
start:
pulsout dmxdata,1 ( pic @ 20Mhz will make this 2uS)
pulsout dmx data,1
goto start
**************************************************
When i look at the signal on my oscilloscope, i see a clean 2uS pulse, then almost 10uS delay until the follwing pulse of 2uS is generated.
I want to know WHY is there almost 10uS between my 'pulsout' commands?
According to the picbasic pro book, if i run a pic at 20Mhz, the MINIMUM delay achievable is 3uS
So, my above example, i was expecting to see at least 3uS between my 2 pulsout commands, and not something as large as 10uS.
I prefer BASIC since it's easier for me, but if i HAVE TO add some asm bits within my BASIC code, then so be it ;-(
(asm...endasm)
Is there soemthing i've completely overlooked on a picf877?
Thanx in advance,
Marty.
I'm trying to make a small DMX (lighting) test box, and i was going to create the dmx signal by using a combination of "pulsout" and "pauseus" commands to meet the timing standard of DMX.
My problem is that my pic 'F877 running at 20Mhz has some form of of delay between my commands.
I completely stripped my code down, and experimented wiht only the folling snippet of code :
************************************************** *
INCLUDE "modedefs.bas"
DEFINE OSC 20
dmxdata VAR PORTA.0 'variable dmx to portA bit0.
TRISA=0 'set port A as OUTPUTS
start:
pulsout dmxdata,1 ( pic @ 20Mhz will make this 2uS)
pulsout dmx data,1
goto start
**************************************************
When i look at the signal on my oscilloscope, i see a clean 2uS pulse, then almost 10uS delay until the follwing pulse of 2uS is generated.
I want to know WHY is there almost 10uS between my 'pulsout' commands?
According to the picbasic pro book, if i run a pic at 20Mhz, the MINIMUM delay achievable is 3uS
So, my above example, i was expecting to see at least 3uS between my 2 pulsout commands, and not something as large as 10uS.
I prefer BASIC since it's easier for me, but if i HAVE TO add some asm bits within my BASIC code, then so be it ;-(
(asm...endasm)
Is there soemthing i've completely overlooked on a picf877?
Thanx in advance,
Marty.