Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

Discussion Groups | Piclist | Re: Re: Instruction Time - USART and DMX

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

Re: Re: Instruction Time - USART and DMX - Paul_Lav - Mar 14 14:26:00 2006

Hi.
 
I have managed to get the PIC to transmit a 9 bit signal (well i think it is, not really got a way of testing it) So thinking about the init signal i need, i'm thinking the only way is to turn off USART, set the bit as an output, set it low for x us, then high for x us, turn the usart back on, set the bit as input, then send all the bytes i need? Sound ok? Am gonna try it out tomorrow, then test it hopefully day after, when my DMX tester arrives!
 
Thanks for your help,
Paul
----- Original Message -----
From: Stef Mientki
To: p...@yahoogroups.com
Sent: Monday, March 13, 2006 7:39 PM
Subject: Re: [piclist] Re: Instruction Time


>But, I still don't see how a high level language can do something
>that can't be done in hardware or assembly language.

>
It can be done in hardware easily, but for some obscure reason microchip
didn't do that.
It can be done in software, to give you a hint:
try overloading the (bit) writing-part of the IO-port (other memory
location aren't a problem).

Stef Mientki





(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )


Re: Re: Instruction Time - USART and DMX - Harold Hallikainen - Mar 14 16:11:00 2006

I think I missed some of this thread, but it looks like you're trying to
send the break in the DMX. Newer chips have a break command in the USART,
but it is not long enough for DMX. Since I'm often transmitting and
receiving DMX simultaneously, I can't shut down the USART to send a break.
Instead, I have a resistor between the TX pin and the 485 driver. I have
another PIC pin connected to the far side of the resistor (to the driver
input). The latch bit for that pin is programmed low during
initialization. When I want to send a break, I clear the TRIS bit for that
pin, pulling the driver input low. Setting the TRIS bit high lets the
USART drive the driver. One tricky part is syncing the break with USART
data. This is tricky because the USART sets TXIF when there is space in
the holding register, but it is still shifting data out of the shift
register. What I've done is use a timer interrupt instead of the USART
interrupt. Depending on the state of the DMX transmit interrupt service
routine, it sets a break, clears a break, sends a start code, or sends
data.

Harold
	> Hi.
>
> I have managed to get the PIC to transmit a 9 bit signal (well i think it
> is, not really got a way of testing it) So thinking about the init signal
> i need, i'm thinking the only way is to turn off USART, set the bit as an
> output, set it low for x us, then high for x us, turn the usart back on,
> set the bit as input, then send all the bytes i need? Sound ok? Am gonna
> try it out tomorrow, then test it hopefully day after, when my DMX tester
> arrives!
>
> Thanks for your help,
> Paul
>   ----- Original Message -----
>   From: Stef Mientki
>   To: piclist@picl...
>   Sent: Monday, March 13, 2006 7:39 PM
>   Subject: Re: [piclist] Re: Instruction Time
>
>
>
>   >But, I still don't see how a high level language can do something
>   >that can't be done in hardware or assembly language.
>   >
>   >
>   It can be done in hardware easily, but for some obscure reason microchip
>   didn't do that.
>   It can be done in software, to give you a hint:
>   try overloading the (bit) writing-part of the IO-port (other memory
>   location aren't a problem).
>
>   Stef Mientki
>
>
>
>   to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
>
>
>
>   SPONSORED LINKS Microcontroller  Microprocessor  Microchip pic
>         Microcontrollers  Picmicro  Pic microcontrollers
>
>
> ------------------------------------------------------------------------------
>   YAHOO! GROUPS LINKS
>
>     a..  
>
>
> ------------------------------------------------------------------------------
>
>
	-- 
FCC Rules Updated Daily at http://www.hallikainen.com



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )

Re: Instruction Time - USART and DMX - rtstofer - Mar 14 21:03:00 2006

Neat idea!

Richard

--- In piclist@picl..., "Harold Hallikainen" <harold@...> wrote:
>
> I think I missed some of this thread, but it looks like you're trying to
> send the break in the DMX. Newer chips have a break command in the
USART,
> but it is not long enough for DMX. Since I'm often transmitting and
> receiving DMX simultaneously, I can't shut down the USART to send a
break.
> Instead, I have a resistor between the TX pin and the 485 driver. I have
> another PIC pin connected to the far side of the resistor (to the driver
> input). The latch bit for that pin is programmed low during
> initialization. When I want to send a break, I clear the TRIS bit
for that
> pin, pulling the driver input low. Setting the TRIS bit high lets the
> USART drive the driver. One tricky part is syncing the break with USART
> data. This is tricky because the USART sets TXIF when there is space in
> the holding register, but it is still shifting data out of the shift
> register. What I've done is use a timer interrupt instead of the USART
> interrupt. Depending on the state of the DMX transmit interrupt service
> routine, it sets a break, clears a break, sends a start code, or sends
> data.
> 
> Harold
> 
> 
> > Hi.
> >
> > I have managed to get the PIC to transmit a 9 bit signal (well i
think it
> > is, not really got a way of testing it) So thinking about the init
signal
> > i need, i'm thinking the only way is to turn off USART, set the
bit as an
> > output, set it low for x us, then high for x us, turn the usart
back on,
> > set the bit as input, then send all the bytes i need? Sound ok? Am
gonna
> > try it out tomorrow, then test it hopefully day after, when my DMX
tester
> > arrives!
> >
> > Thanks for your help,
> > Paul
> >   ----- Original Message -----
> >   From: Stef Mientki
> >   To: piclist@picl...
> >   Sent: Monday, March 13, 2006 7:39 PM
> >   Subject: Re: [piclist] Re: Instruction Time
> >
> >
> >
> >   >But, I still don't see how a high level language can do something
> >   >that can't be done in hardware or assembly language.
> >   >
> >   >
> >   It can be done in hardware easily, but for some obscure reason
microchip
> >   didn't do that.
> >   It can be done in software, to give you a hint:
> >   try overloading the (bit) writing-part of the IO-port (other memory
> >   location aren't a problem).
> >
> >   Stef Mientki
> >
> >
> >
> >   to unsubscribe, go to http://www.yahoogroups.com and follow the
> > instructions
> >
> >
> >
> >   SPONSORED LINKS Microcontroller  Microprocessor  Microchip pic
> >         Microcontrollers  Picmicro  Pic microcontrollers
> >
> >
> >
------------------------------------------------------------------------------
> >   YAHOO! GROUPS LINKS
> >
> >     a..  
> >
> >
> >
------------------------------------------------------------------------------
> >
> >
> 
> 
> -- 
> FCC Rules Updated Daily at http://www.hallikainen.com
>
	


(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )