5K$ (CAN Or even USD) is all you need to have a mine... IN PBP+ASM
Therečs a tons of working ASM, C, and maybe BASIC routines here and there, the key is to understand, test, the protocol itself.
I'm a DJ as well![]()
5K$ (CAN Or even USD) is all you need to have a mine... IN PBP+ASM
Therečs a tons of working ASM, C, and maybe BASIC routines here and there, the key is to understand, test, the protocol itself.
I'm a DJ as well![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
it is ok friends i will work to make it bymyself and i wills end to this forum my code when it is ok
I don't think anybody here is suggesting that you do it 'by yourself', but a bit of effort on your part wouldn't hurt the effort on anybody else's part...in other words...I can't speak for everybody, but, we'll help you as much as you help yourself...
So get writing some code...(and put away all the sharp objects within reach)
My lab is in rework right now (remember the water damage awhile back?)...
All I've got right now is some good smelling left over paint (wait 'till I post the pictures of the walls) and a bunch of wood that will become work benches...
I've got lots of sharp objects and power tools within reach...but no electronics to work on...
@Mister_e
@Skimask
thanks for help me and look to my code please what is problem on it i have pic 16F877A and i use pbp 2,47 i have found this code int he forum and little designed it back for my Pic16F877A but it is not working i want to dim a led on portc1 (portc1and portc2 is pwm port on 877A pic) i want to dimming it but some probşlem on the code can you look and say what is my problem here?
'----------------------------------------------------------------------
INCLUDE "modedefs.bas"
@ DEVICE HS_OSC
@ DEVICE pic16F877A
@ DEVICE pic16F877A, WDT_OFF
@ DEVICE pic16F877A, PWRT_ON
@ DEVICE pic16F877A, PROTECT_OFF
@ DEVICE pic16F877A, BOD_OFF
'----------------------------------------------------------------------
DEFINE OSC 20
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
DEFINE HSER_SPBRG 4
DEFINE HSER_BAUD 250000
DEFINE HSER_CLROERR 1
'----------------------------------------------------------------------
counter VAR word
idleflag VAR WORD
dummy VAR WORD
RCIF VAR byte
startcode VAR WORD
aminus VAR WORD
adresse_grada VAR WORD
x VAR WORD
newlevel1 VAR WORD
'----------------------------------------------------------------------
TRISB=0
TRISC=%10000000 ' portc.7 is RX input
ADCON0=0
ADCON1=7
adresse_grada=2
checkdmx:
counter = 1
pulsin portc.7,0,counter ' portc.7 is RX input
if counter = 0 then
idleflag = 1
endif
if counter < 40 then checkdmx
dummy = RCREG
dummy = RCREG
SPBRG = 0
TXSTA.2 = 0
TXSTA.4 = 0
RCSTA.7 = 1
RCSTA.6 = 0
RCSTA.4 = 0
RCSTA.4 = 1
while RCIF = 0:wend
startcode = RCREG
if startcode <> 0 then checkdmx
aminus = adresse_grada - 1 'address1 is my target address
for x = 1 to aminus
while RCIF = 0:WEND
dummy = RCREG
next x
newlevel1 = RCREG
pwm portc.1,newlevel1 ,100 'i want dimming a LED on PORTC.1
RCSTA.7 = 0 'turn off the USART
goto checkdmx
return
PWM doesn't run in the background... When you hit a PWM command, that's what you get, one shot, one pulse of PWM, then you loop back and start checking for more DMX data input, which you probably missed because you were trying to do PWM in the first place, and while you are waiting for some DMX data, your LED is off because the PIC isn't executing a PWM command. See how it all ties in together to make a seemingly non-working version of the code?
And what have you changed and/or tried to change in the code to make it work? Anything?
What you want is some interrupt driven code...interrupt driven serial input, interrupt driven PWM (or a hardware module, whichever works for you).
There's too much high speed stuff going on to be handled sequentially... Do a search for Instant Interrupts and Slow Speed Pulse Width Modulation. This code you've 'found' and keep copying probably isn't going to work for you in the end without knowing what's really going on in the first place and how to use interrupts.
Bookmarks