Exact match. Not showing close matches.
PICList
Thread
'[PIC]:UART problem'
2001\03\05@221150
by
David Huisman
Does anyone have any example "C" code for Interrupt driven TX routine using
UART
? I have looked at piclist.com and cannot find what I need there.
I can get the TX started but it will not stop.
I tried using TXEN to stop it, but then it reconfigures the port to hi-Z.
Currently I initiate transmission by loading TXREG with 1st data byte from
tx_buffer[0] and inc tx_ptr to 1.
Next I set TXIE to true.
In the interrupt routine I poll (TXIF & TXIE)
Each time a byte is sent, I inc TX_Ptr and when all is sent I disable TXIE.
If I enable TXIE and load TXREG, the uart sends for a while and results in
stack overflow.
If I do not set TXIE, it transmits forever even though it never gets to the
int routine.
--
http://www.piclist.com hint: The PICList is archived three different
ways. See http://www.piclist.com/#archives for details.
2001\03\05@224615
by
James Cameron
2001\03\05@230711
by
David Huisman
2001\03\06@010442
by
Dan Michaels
|
David Huisman wrote:
>Does anyone have any example "C" code for Interrupt driven TX routine using
>UART
>? I have looked at piclist.com and cannot find what I need there.
>
>I can get the TX started but it will not stop.
>
Does this mean it keeps transmitting the "same" data over and over,
or different data?
=============
>
>Currently I initiate transmission by loading TXREG with 1st data byte from
>tx_buffer[0] and inc tx_ptr to 1.
>Next I set TXIE to true.
>
And of course, you did clear TXIF?
========
>In the interrupt routine I poll (TXIF & TXIE)
>Each time a byte is sent, I inc TX_Ptr and when all is sent I disable TXIE.
>
And clear TXIF?
=========
>If I enable TXIE and load TXREG, the uart sends for a while and results in
>stack overflow.
Return stack? or a s.w. stack you created?
If the former, then it sounds like you are not returning from interrupt
properly.
===========
>If I do not set TXIE, it transmits forever even though it never gets to the
>int routine.
>
You do know that you can use the UART for transmitting, without using
interrupts? Just wait for TXIF to be clear, and then load TXREG.
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspam
@spam@mitvma.mit.edu with SET PICList DIGEST in the body
2001\03\06@081444
by
Thomas McGahee
2001\03\06@145258
by
Orbit Communications
Thomas,
You are right :)
I will re-post with attachment this time :)
Best Regards
David Huisman
----------------------------------------------------------------
Orbit Communications
Reliable RF data modules,wireless telemetry rfic and other
communication solutions
Web site: http://www.orbitcoms.com
Email: info
spam_OUTorbitcoms.com
PO Box 3459, Tuggerah, NSW 2259, Australia
Phone:+61-2-4329-7765
Fax:+61-2-4329-7893
Mobile (within Australia): +61-0412-566-629
Mobile (International): +61-412-566-629
{Original Message removed}
2001\03\06@165358
by
David Huisman
2001\03\06@170225
by
Sam Linder
2001\03\06@171053
by
David VanHorn
2001\03\06@184857
by
Thomas McGahee
2001\03\06@192503
by
David Huisman
2001\03\06@195705
by
Sam Linder
2001\03\06@205002
by
James Newton
2001\03\06@232810
by
James Cameron
On Wed, Mar 07, 2001 at 11:08:29AM +1100, David Huisman wrote:
> The code was sent as attachments. Do I need to cut and paste code into
> email itself ?
Yes, the list server must be dropping your large file. I received it
fine bypassing the list when you sent it to me. Probably best to reduce
the code into the essential components rather than post the whole source
file.
I'm afraid I couldn't find anything wrong with your code, except what I
mentioned, but I didn't think that should have caused the problem. If
you do find out what the cause was, please let me know.
--
James Cameron spamBeGonequozl
KILLspamus.netrek.org http://quozl.netrek.org/
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservspam_OUT
mitvma.mit.edu with SET PICList DIGEST in the body
More... (looser matching)
- Last day of these posts
- In 2001
, 2002 only
- Today
- New search...