Searching \ for 'DMX Sender (have I use one or two PICs?)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/displays.htm?key=dmx
Search entire site for: 'DMX Sender (have I use one or two PICs?)'.

Truncated match.
PICList Thread
'DMX Sender (have I use one or two PICs?)'
1999\10\27@095443 by Edson Brusque

face
flavicon
face
Hello,

   I'm working on a DMX sender and have to make a decision.

   I've tried to make it with two PIC16F84. One is for LCD display control
who is receiving RS232 at 9600bps. The other do all the remaining functions,
scans the keypad, sends DMX and sends RS232 to the LCD controller.

   This aproach worked ok, but I'm trying to make it with a PIC16F877
(final unit would use a PIC16F873). The problem is that I'm using the TIMER1
(16 bits) to send DMX at it's interrupt and the TIMER0 (8 bits) to control
the display at it's interrupt. So, everytime the DMX packet is sent (aprox 4
times for each second), the display makes a little stop.

   Someone have some tip on it's trick bag to help me? Or I have to give it
up and return to use two PICs?

   Best regards,

   Brusque
___________________________________________________________________________
| | || |\| | || || |\|\ Edson Brusque :-^= (spam_OUTbrusqueTakeThisOuTspamflynet.com.br)
| | || ||| | || || |||| Musician, Tech Consultant, Programmer, Developer
| |_||_||| |_||_||_|||| Rodeio / SC / Brazil / Earth / Solar Syst / Milk...
| \_\\_\|| \_\\_\\_\||| Giro In'Italia homepage: http://flynet.com.br/giro
|  |  |  |  |  |  |  || C.I.Tronics Lighting Designers: citronics.com.br
|__|__|__|__|__|__|__||---------------- ICQ# 15937748 ---------------------
\__\__\__\__\__\__\__\|        The SoundFont Users Group Mailing List is at
----------------------|   www.geocities.com/SiliconValley/Port/6619/
---------------------------------------------------------------------------

1999\10\27@122328 by Harold M Hallikainen

picon face
       I don't recall if your PIC had a serial port, which would make a
difference.  I've got several products that are simultaneously sending
and receiving DMX, scanning pots and keyswitches, exchanging data with
printer ports, etc.  These are all with a single 16c74 running at 16 MHz.
If you're bit banging... good luck!

Harold



Harold Hallikainen
.....haroldKILLspamspam@spam@hallikainen.com
Hallikainen & Friends, Inc.
See the FCC Rules at http://hallikainen.com/FccRules and comments filed
in LPFM proceeding at http://hallikainen.com/lpfm

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\10\27@131352 by Edson Brusque

face
flavicon
face
   Harold,

>         I don't recall if your PIC had a serial port, which would make a
> difference.  I've got several products that are simultaneously sending
> and receiving DMX, scanning pots and keyswitches, exchanging data with
> printer ports, etc.  These are all with a single 16c74 running at 16 MHz.
>  If you're bit banging... good luck!

   Do you send and receive a DMX packet while doing other things? Using the
USART interrupts? The PIC16C87X have an USART that I think is capable of
this, but as I'm new to controllers, I haven't the time to try it yet.

   What do you mean with 'bit banging'?

   Best regards,

   Brusque
___________________________________________________________________________
| | || |\| | || || |\|\ Edson Brusque :-^= (brusquespamKILLspamflynet.com.br)
| | || ||| | || || |||| Musician, Tech Consultant, Programmer, Developer
| |_||_||| |_||_||_|||| Rodeio / SC / Brazil / Earth / Solar Syst / Milk...
| \_\\_\|| \_\\_\\_\||| Giro In'Italia homepage: http://flynet.com.br/giro
|  |  |  |  |  |  |  || C.I.Tronics Lighting Designers: citronics.com.br
|__|__|__|__|__|__|__||---------------- ICQ# 15937748 ---------------------
\__\__\__\__\__\__\__\|        The SoundFont Users Group Mailing List is at
----------------------|   www.geocities.com/SiliconValley/Port/6619/
---------------------------------------------------------------------------

1999\10\27@140315 by paulb

flavicon
face
Edson Brusque wrote:

>   I've tried to make it with two PIC16F84.  One is for LCD display
> control who is receiving RS232 at 9600bps.

 I trust you refer to an LCD display module using a HD44780 controller
or similar?

> The other do all the remaining functions, scans the keypad, sends DMX
> and sends RS232 to the LCD controller.

 Noted: sends DMX.  Generally held to be far easier than receiving it!

>  This aproach worked ok, but I'm trying to make it with a PIC16F877
> (final unit would use a PIC16F873).

 This chip has a UART.  Should send DMX with considerable ease.  Need
to use suitable crystal of course.

> The problem is that I'm using the TIMER1 (16 bits) to send DMX at it's
> interrupt

 Why do you need this interrupt to send the DMX if you have the UART?

> and the TIMER0 (8 bits) to control the display at it's interrupt.

 Why do you need a timer to control the LCD?  Why interrupt?

> So, everytime the DMX packet is sent (aprox 4 times for each second),
> the display makes a little stop.

 How can the display "stop"?  I shouldn't have thought it was going
very far. :)  IOW, what does it need to update so rapidly that the
pause can be seen?

>  Someone have some tip on it's trick bag to help me? Or I have to give
> it up and return to use two PICs?

 Look, I'm not an expert but I would have thought this chip has a
hardware UART to do the DMX, so you use it for that function.  It would
appear to have more than enough pins to drive an LCD and keyboard as
well, and using the hardware UART, you should have no speed problems.

 In particular, using two PICs as it seems to me, would lead you to
waste inordinate resources (time, code space) simply communicating
between the two.  Lack of space for strings should be the major reason
you couldn't do it all in *one* 16F84, so am 877 or 873 should be a
piece of cake.

 And I doubt you'd have any need to use interrupts for this task; the
code should be quite able to perform a given step and poll the timer if
it needs to delay by a precise period to the next step.  LCD display
code could be interleaved into this and should thereby be self-
regulating.
--
 Cheers,
       Paul B.

1999\10\27@172942 by Harold M Hallikainen

picon face
On Wed, 27 Oct 1999 15:13:30 -0200 Edson Brusque <.....brusqueKILLspamspam.....FLYNET.COM.BR>
writes:
>    Harold,
>
>
>    Do you send and receive a DMX packet while doing other things? Using
the
>USART interrupts? The PIC16C87X have an USART that I think is capable of
>this, but as I'm new to controllers, I haven't the time to try it yet.
>
>    What do you mean with 'bit banging'?
>

       Yes, I'm transmitting, receiving, and doing other stuff
simultaneously.  I have a receive buffer in RAM that is continuously
being overwritten by incoming DMX.  I have a transmit buffer that is
continuously being sent out on DMX (by the way, while I use the USART
receive interrupt, I don't use the transmit interrupt because of
difficulty syncing the break with transmitted characters.  Instead, I use
a timer interrupt for transmit of bytes and transmit of break).  Other
stuff (A/D reading pots, printer port communications, etc.) is all done
by non-interrupt code.
       Bit banging is transmitting (and receiving) serial data without
the aid of a USART.  You spend a lot of time doing bit timing and hoping
you sample the line at the right time.  USARTs are nice!

Harold


Harold Hallikainen
EraseMEharoldspam_OUTspamTakeThisOuThallikainen.com
Hallikainen & Friends, Inc.
See the FCC Rules at http://hallikainen.com/FccRules and comments filed
in LPFM proceeding at http://hallikainen.com/lpfm

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\10\27@182541 by Edson Brusque

face
flavicon
face
Harold,

>         Yes, I'm transmitting, receiving, and doing other stuff
> simultaneously.  I have a receive buffer in RAM that is continuously
> being overwritten by incoming DMX.  I have a transmit buffer that is
> continuously being sent out on DMX (by the way, while I use the USART
> receive interrupt, I don't use the transmit interrupt because of
> difficulty syncing the break with transmitted characters.  Instead, I use
> a timer interrupt for transmit of bytes and transmit of break).  Other
> stuff (A/D reading pots, printer port communications, etc.) is all done
> by non-interrupt code.

   I'll try to redesign the code using the USART of the PIC16F877. I'll run
the PIC at 20MHz, so it'll give me no error rate. I'm thinking of using a
TIMMER interrupt running once each 240 instructions (12 bits), and each time
it is invoked, I'll give instructions to the USART to send one byte. The LED
display will be running with another TIMMER interrupt. The keypad will be
handled with the RBINT interrupt. Hope this will work...

   Best regards and thanks for all your help,

   Brusque

P.S.: I've took a rapid look at DOVE SYSTEMS site. Why is the StarPort so
expensive?

___________________________________________________________________________
| | || |\| | || || |\|\ Edson Brusque :-^= (brusquespamspam_OUTflynet.com.br)
| | || ||| | || || |||| Musician, Tech Consultant, Programmer, Developer
| |_||_||| |_||_||_|||| Rodeio / SC / Brazil / Earth / Solar Syst / Milk...
| \_\\_\|| \_\\_\\_\||| Giro In'Italia homepage: http://flynet.com.br/giro
|  |  |  |  |  |  |  || C.I.Tronics Lighting Designers: citronics.com.br
|__|__|__|__|__|__|__||---------------- ICQ# 15937748 ---------------------
\__\__\__\__\__\__\__\|        The SoundFont Users Group Mailing List is at
----------------------|   www.geocities.com/SiliconValley/Port/6619/
---------------------------------------------------------------------------

1999\10\27@194548 by Harold M Hallikainen

picon face
On Wed, 27 Oct 1999 20:24:51 -0200 Edson Brusque <@spam@brusqueKILLspamspamFLYNET.COM.BR>
writes:
>Harold,
>
>
>    I'll try to redesign the code using the USART of the PIC16F877.
>I'll run the PIC at 20MHz, so it'll give me no error rate.

       I don't think you can hit 250 kbps with 20 MHz.  I use 16 MHz.

>I'm thinking of using a TIMMER interrupt running once each 240
instructions (12 bits), and
>each time it is invoked, I'll give instructions to the USART to send one
byte.

       Since each byte is 11 bits (start, 8 data, 2 stop), and takes
4uS, I'd have the timer generate an interrupt every 44 to 50uS.  I then
use that to either dump a byte into the transmit register or generate a
break.  Since the USART does not have a break command, I used another I/O
pin for that.  The USART output pin goes through a resistor to the 488
driver.  The input of the 488 driver ALSO connects to another I/O pin
that is normally in the input mode with the output bit set low.  When I
want to do a break, I change the pin to output mode, passing through the
low in the output latch, shorting the resistor isolated data to ground...
instant break!  At the next timer interrupt, the pin is changed back to
input.  Another interrupt later, the USART is loaded with the next byte
(the start code).  The "one interrupt" between end of break and sending
the next character insures there is adequate mark after break (MAB).
Here, it's a litte over one byte's time (44 uS).

>The LED display will be running with another TIMMER interrupt. The
keypad will
>be handled with the RBINT interrupt. Hope this will work...

       Is it a multiplexed display?  Can the display routine be called
by the same timer interrupt?

>
>    Best regards and thanks for all your help,
>

       You're welcome!  I get a lot of good ideas from the list, so I'll
share a opinions on stuff...


>    Brusque
>
>P.S.: I've took a rapid look at DOVE SYSTEMS site. Why is the StarPort
>so expensive?
>


       Couple reasons...  A tremendous amount was invested in the
software that runs on the PC.  This was written before I got here, but it
came with the aquisition of another company plus lots of maintenance, and
finally my interface code to the StarPort (which is a very small part of
it).  We're SLOWLY moving it over to Windoze, but I keep getting
sidetracked onto other projects.  Reason #2...  It's about where the
competition is...


Harold

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\10\27@201947 by Edson Brusque

face
flavicon
face
Harold,

>         I don't think you can hit 250 kbps with 20 MHz.  I use 16 MHz.

   According to page 109 of the PIC16F87X literature (DS30292A), with
FOSC=20MHz, BRGH=1 and SPBRG=10, the USART works at 250Kbaud with 0%Error.

{Quote hidden}

   I thought that stoping telling the USART to output a byte would maintain
it in idle mode, so, with it's output HI (the same as a break). Isn't it?

>         Is it a multiplexed display?  Can the display routine be called
> by the same timer interrupt?

   Yes, I'm multiplexing it, and it could probably be called by the same
timer interrupt. I'll try both it ways.

>         Couple reasons...  A tremendous amount was invested in the
> software that runs on the PC.  This was written before I got here, but it
> came with the aquisition of another company plus lots of maintenance, and
> finally my interface code to the StarPort (which is a very small part of
> it).  We're SLOWLY moving it over to Windoze, but I keep getting
> sidetracked onto other projects.  Reason #2...  It's about where the
> competition is...

   Ok, I'll dive deeper at DOVE site to see the cool things you are doing.

   Best regards.

   Brusque
___________________________________________________________________________
| | || |\| | || || |\|\ Edson Brusque :-^= (KILLspambrusqueKILLspamspamflynet.com.br)
| | || ||| | || || |||| Musician, Tech Consultant, Programmer, Developer
| |_||_||| |_||_||_|||| Rodeio / SC / Brazil / Earth / Solar Syst / Milk...
| \_\\_\|| \_\\_\\_\||| Giro In'Italia homepage: http://flynet.com.br/giro
|  |  |  |  |  |  |  || C.I.Tronics Lighting Designers: citronics.com.br
|__|__|__|__|__|__|__||---------------- ICQ# 15937748 ---------------------
\__\__\__\__\__\__\__\|        The SoundFont Users Group Mailing List is at
----------------------|   www.geocities.com/SiliconValley/Port/6619/
---------------------------------------------------------------------------

1999\10\28@042845 by Kelly J Kohls

picon face
Brusque,

I have built both a DMX receiver and transmitter (both based on the 16C76
@ 20 MHz).  Information about the receiver is posted on my
homepage.  With regards to the transmitter, I haven't yet had a chance to
get the schematic in a presentable state.  Once I do, I will post
the transmitter project as well.

In order to make generating the break easier, I tied a resistor from the
output pin of the UART to ground.  When it became time to generate
the break, I disabled the transmitter part of the UART.  This places the
output pin of the UART in a high impedance state.  Since the resistor on
the
output pin is tied to ground, this caused the input of the RS485
transmitter to go low, thus generating the break.  When the break was
finished, the
UART transmitter was re-enabled, the start code sent, and the dimmer
values transmitted.  Then the whole process started over.

Kelly Kohls, N5TLE
Dallas, TX
Email:  RemoveMEkkohlsTakeThisOuTspamjuno.com  OR  spamBeGonen5tlespamBeGonespamqsl.net
Website:  http://www.qsl.net/n5tle/

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\10\28@091142 by paulb

flavicon
face
Edson Brusque wrote:

>   I thought that stopping telling the USART to output a byte would
> maintain it in idle mode, so, with it's output HI (the same as a
> break).  Isn't it?

 No.  A break is a "space" condition (Low on the logic line, positive
voltage on the RS-232) occurring for much longer than two characters.
Idle is as you say, continuous marking.

 The break is used for an "attention" function - something not able to
be communicated as a character.  It can also be seen as a NUL character
continuing beyond the (missing) stop bit.  In fact you generally get a
NUL ($00) detected and passed on before it is realised that it is
actually a break - something to be taken into account.

 Idle OTOH, generates no characters in the receiver.
--
 Cheers,
       Paul B.

1999\10\28@101400 by Harold M Hallikainen

picon face
On Wed, 27 Oct 1999 22:12:56 -0200 Edson Brusque <TakeThisOuTbrusqueEraseMEspamspam_OUTFLYNET.COM.BR>
writes:
>
>     According to page 109 of the PIC16F87X literature (DS30292A),
> with  FOSC=20MHz, BRGH=1 and SPBRG=10, the USART works at 250Kbaud with

> 0%Error.
>

       Ahh!  Yes, when I designed this code, BRGH didn't work!  So I went with
16 MHz.  They've fixed that now!


>
>
>     I thought that stoping telling the USART to output a byte would
> maintain  it in idle mode, so, with it's output HI (the same as a
break).
> Isn't it?

       A BREAK is with the USART output LOW.  This all comes about from Morse's
telegraph where there was a continuous loop of all the stations.  When
there was loop current (USART high, EIA232 at -12V), the original inking
telegraph would MARK the paper while an open circuit (no loop current)
would leave a SPACE on the paper.  The telegrapher could put down dots
and dashes through the proper combination of MARK and SPACE.
       Since all stations were in SERIES, the idle condition was MARK.  Each
station would close the shorting switch on their key.  They'd break the
circuit when they needed to send a message (closing it when they pushed
down on the key).
       When we moved to mechanical Teletypes, the idle condition remained the
MARK condition of having current in the loop (typically 60 or 20 mA).
When the start bit (space) came along, a clutch would be released
(actually, a catch would allow the slipping clutch to stop slipping).
This was followed by the data bits (originally 5 data bits for the Baudot
code) and then the MARK stop bit (originally 1.5 bits long though the
rotation of the receive shaft only required 1 stop bit... the extra
transmitted 0.5 bit of mark allowed for speed variation between
transmitter and receiver... Many Teletypes used governor regulated DC
motors).
       When the current loop for a Teletype is opened (sending a BREAK), the
machine "runs open", making a lot of noise.  The selector magnets never
stop the rotation of the receive shaft, so the mechanism just keeps going
and going...
       So... back on DMX, a BREAK is a continuous SPACE (low out of the USART)
while the USART idles in the MARK (high out of the USART) condition (just
adding more and more stop bits).
>
>


Have fun with it!


Harold

___________________________________________________________________
Get the Internet just the way you want it.
Free software, free e-mail, and free Internet access for a month!
Try Juno Web: dl.http://www.juno.com/dynoget/tagj.

1999\10\28@151145 by Edson Brusque

face
flavicon
face
Hello,

   I would like to thanks for all the ones who gave me tips. I think now
I'm in the right way.

   Two more questions:

   1) No matter what I do, I can't set the PORTA.4 pin HI. If I set it LO,
it's ok. When I set it HI, it seens to go to high impedance state. Someone
can tell me what's going on?

   2) When enabling the USART, do I loose the PORTB.7 pin, even if I didn't
set RX?

   Best regards,

   Brusque
___________________________________________________________________________
| | || |\| | || || |\|\ Edson Brusque :-^= (RemoveMEbrusquespamTakeThisOuTflynet.com.br)
| | || ||| | || || |||| Musician, Tech Consultant, Programmer, Developer
| |_||_||| |_||_||_|||| Rodeio / SC / Brazil / Earth / Solar Syst / Milk...
| \_\\_\|| \_\\_\\_\||| Giro In'Italia homepage: http://flynet.com.br/giro
|  |  |  |  |  |  |  || C.I.Tronics Lighting Designers: citronics.com.br
|__|__|__|__|__|__|__||---------------- ICQ# 15937748 ---------------------
\__\__\__\__\__\__\__\|        The SoundFont Users Group Mailing List is at
----------------------|   www.geocities.com/SiliconValley/Port/6619/
---------------------------------------------------------------------------

1999\10\28@154447 by Dave Minkler

flavicon
face
PORTA.4 is an open collector type.  Got bit by that one myself.  You'll
need a pullup resistor.

mink

1999\10\28@160958 by John De Villiers

flavicon
face
>
>     1) No matter what I do, I can't set the PORTA.4 pin HI. If I
> set it LO,
> it's ok. When I set it HI, it seens to go to high impedance state. Someone
> can tell me what's going on?
>

PortA.4 is open collector output. That means that it can only tie the pin to
ground. It doesnt have the bit to connect it to Vcc like the other pins do.

john

1999\10\28@165828 by Edson Brusque

face
flavicon
face
Hello,

> PortA.4 is open collector output. That means that it can only tie the pin
to
> ground. It doesnt have the bit to connect it to Vcc like the other pins
do.

This means I cannot use it as output? What can I do with it then (besides
input)?

___________________________________________________________________________
| | || |\| | || || |\|\ Edson Brusque :-^= (brusqueEraseMEspam.....flynet.com.br)
| | || ||| | || || |||| Musician, Tech Consultant, Programmer, Developer
| |_||_||| |_||_||_|||| Rodeio / SC / Brazil / Earth / Solar Syst / Milk...
| \_\\_\|| \_\\_\\_\||| Giro In'Italia homepage: http://flynet.com.br/giro
|  |  |  |  |  |  |  || C.I.Tronics Lighting Designers: citronics.com.br
|__|__|__|__|__|__|__||---------------- ICQ# 15937748 ---------------------
\__\__\__\__\__\__\__\|        The SoundFont Users Group Mailing List is at
----------------------|   www.geocities.com/SiliconValley/Port/6619/
---------------------------------------------------------------------------

1999\10\28@170242 by M. Adam Davis

flavicon
face
You can use it as an output, but it only outputs low (not as useful,
eh?)

A common use is to tie it high with a pull-up resister.  When you send a
1 to it, it basicly leaves the pin floating, and the pull-up resister
brings the line high.  When you send a 0 it pulls the pin low.

-Adam

Edson Brusque wrote:
{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...