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.
----- Original Message -----From: Stef MientkiTo: p...@yahoogroups.comSent: Monday, March 13, 2006 7:39 PMSubject: 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 )
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
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 >