Join our technical discussions about Freescale Microcontrollers: M68HC12. (Freescale Semiconductor is a Subsidiary of Motorola).
|
Hi All, I'm working on a HC12A4 project. I use the SC1 lines with interrupts. I have no problem with receiving, but transmitting. Sometimes the first character fails, all other are right. Maybe my register init order is bad. Could anybody send me an useful initialization method for transmission with interrupts (TDRE)? Thanks in advance, Béla [Non-text portions of this message have been removed] |
|
|
|
I never will again try to use TxEmpty interrupts...never got them to work properly. I suggest you skip it too! Armand -----Original Message----- From: Zámbó Béla [mailto:] Sent: Tuesday, August 06, 2002 11:43 AM To: Subject: [68HC12] SCI problem Hi All, I'm working on a HC12A4 project. I use the SC1 lines with interrupts. I have no problem with receiving, but transmitting. Sometimes the first character fails, all other are right. Maybe my register init order is bad. Could anybody send me an useful initialization method for transmission with interrupts (TDRE)? Thanks in advance, Béla [Non-text portions of this message have been removed] -------------------------------------------------------- To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit http://www.motorola.com/mcu |
|
|
|
It's sounds very strange :( I don't give up... (still) Béla |
|
I used a TI RS232 chip which went into sleep mode if it received no activity for a certain amount of time. I had to change chips because it always dropped the first character I sent. Mike ----- Original Message ----- From: "Zámbó Béla" <> To: <> Sent: Tuesday, August 06, 2002 2:00 PM Subject: Re: [68HC12] SCI problem > It's sounds very strange :( > I don't give up... (still) > Béla > > -------------------------------------------------------- > To unsubscribe from this group, send an email to: > To learn more about Motorola Microcontrollers, please visit > http://www.motorola.com/mcu |
|
I have a working example ... what is Bela's e-mail address? At 11:49 AM 8/6/2002 -0700, you wrote: >I never will again try to use TxEmpty interrupts...never got them to work >properly. I suggest you skip it too! >Armand >-----Original Message----- >From: Zámbó Béla [mailto:] >Sent: Tuesday, August 06, 2002 11:43 AM >To: >Subject: [68HC12] SCI problem >Hi All, >I'm working on a HC12A4 project. I use the SC1 lines with interrupts. >I have no problem with receiving, but transmitting. Sometimes the first >character fails, all other are right. >Maybe my register init order is bad. Could anybody send me an useful >initialization method for transmission with interrupts (TDRE)? >Thanks in advance, >Béla > >[Non-text portions of this message have been removed] > >-------------------------------------------------------- >To unsubscribe from this group, send an email to: >To learn more about Motorola Microcontrollers, please visit >http://www.motorola.com/mcu > >-------------------------------------------------------- >To unsubscribe from this group, send an email to: >To learn more about Motorola Microcontrollers, please visit >http://www.motorola.com/mcu > -------------------------------------------------------- Jim Bacon Engineer Melles Griot -- Boulder, Colorado 303.581.9635 x329 |
|
Why don't you post some of your code and let everyone look at it. You aren't specific about full/half duplex operation or other parameters either so it's difficult to give advice. Are you manually gating some sort of transceiver chip? --- In 68HC12@y..., Zámbó Béla <zbela@f...> wrote: > Hi All, > I'm working on a HC12A4 project. I use the SC1 lines with interrupts. > I have no problem with receiving, but transmitting. Sometimes the first > character fails, all other are right. > Maybe my register init order is bad. Could anybody send me an useful > initialization method for transmission with interrupts (TDRE)? > Thanks in advance, > Béla > > [Non-text portions of this message have been removed] |
|
I use full duplex operation. The transcevier chip is: SIPEX SP232CPE A pieces of my code: --------------------- ; Transfer start subroutine sci1Tstart ldy #tPuff2 ; Y: transfer buffer address ldaa 1,y brclr SC0SR1,TDRE,* ; wait for transmit data register empty staa SC1DRL ; first data out ldaa 2,y ; second data to transmit brclr SC0SR1,TDRE,* ; wait for transmit data register empty staa SC1DRL ; next data out movb #SC1CR2maskTIE,SC1CR2 ; enable int. (TIE) rtc Only the first data fails often (50%) Béla |
|
You mean it works sometimes, Try setting the IRQ to fetch the char from the buffer
each time it hits, it will work much better -----Original Message----- From: Zámbó Béla [mailto:] Sent: Tuesday, August 06, 2002 3:37 PM To: Subject: Re: [68HC12] Re: SCI problem I use full duplex operation. The transcevier chip is: SIPEX SP232CPE A pieces of my code: --------------------- ; Transfer start subroutine sci1Tstart ldy #tPuff2 ; Y: transfer buffer address ldaa 1,y brclr SC0SR1,TDRE,* ; wait for transmit data register empty staa SC1DRL ; first data out ldaa 2,y ; second data to transmit brclr SC0SR1,TDRE,* ; wait for transmit data register empty staa SC1DRL ; next data out movb #SC1CR2maskTIE,SC1CR2 ; enable int. (TIE) rtc Only the first data fails often (50%) Béla -------------------------------------------------------- To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit http://www.motorola.com/mcu |
|
Every failed data is $37 when I try to send $38 exactly Béla |
|
wow! So it seems the failed data equals the next data!!! How can I overwrite transmit data!? Béla |
|
|
|
Your e-mail address bounces for me. Can you e-mail me directly? (we can skip the free love readings that way, also) At 09:53 PM 8/6/2002 +0200, you wrote: >wow! So it seems the failed data equals the next data!!! >How can I overwrite transmit data!? >Béla > >-------------------------------------------------------- >To unsubscribe from this group, send an email to: >To learn more about Motorola Microcontrollers, please visit >http://www.motorola.com/mcu > -------------------------------------------------------- Jim Bacon Engineer Melles Griot -- Boulder, Colorado 303.581.9635 x329 |
|
*This message was transferred with a trial version of CommuniGate(tm) Pro* Helo Béla I don't know if I'm misunderstanding your labels, but I see you're using SC0SR1 (register for SCI0) and SC1DRL (register for SCI1). Am I wrong? Sergio --------------------- ; Transfer start subroutine sci1Tstart ldy #tPuff2 ; Y: transfer buffer address ldaa 1,y brclr SC0SR1,TDRE,* ; wait for transmit data register empty staa SC1DRL ; first data out ldaa 2,y ; second data to transmit brclr SC0SR1,TDRE,* ; wait for transmit data register empty staa SC1DRL ; next data out movb #SC1CR2maskTIE,SC1CR2 ; enable int. (TIE) rtc Only the first data fails often (50%) Béla ----- Original Message ----- From: "Jim Bacon" <> To: <> Sent: Tuesday, August 06, 2002 3:00 PM Subject: Re: [68HC12] Re: SCI problem *This message was transferred with a trial version of CommuniGate(tm) Pro* Your e-mail address bounces for me. Can you e-mail me directly? (we can skip the free love readings that way, also) At 09:53 PM 8/6/2002 +0200, you wrote: >wow! So it seems the failed data equals the next data!!! >How can I overwrite transmit data!? >Béla > >-------------------------------------------------------- >To unsubscribe from this group, send an email to: >To learn more about Motorola Microcontrollers, please visit >http://www.motorola.com/mcu > -------------------------------------------------------- Jim Bacon Engineer Melles Griot -- Boulder, Colorado 303.581.9635 x329 -------------------------------------------------------- To unsubscribe from this group, send an email to: To learn more about Motorola Microcontrollers, please visit http://www.motorola.com/mcu |