Exact match. Not showing close matches.
PICList
Thread
'[PIC:] putsUSART() : how to avoid the terminating '
2004\07\06@161612
by
Joan Ilari
|
Hi, Piclisters !
In a C18 program I would like to send to 18F242's Usart a char string using
a single (standard) function call AND without outputting the string's
trailing null char (\000). Does any Piclister know how to do it using
standard functions in C18 ?
Of course, I could write my own function to do it (sending char by char to
the Usart while avoiding the trailing null), but I think that it should be
possible to do this with a standard function call.
Unfortunatelly 'putsUSART()' function "writes a string of characters to the
USART including the null character" ("MPLAB C18 C Compiler Libraries") :-((
I guess that I miss some other function, but I am not able to locate it in
the manual ...
Any help to overcome this annoyance will be appreciated !
Joan Ilari
Barcelona (Spain)
================================================================
... I've seen things you people wouldn't believe. Attack ships
on fire off the shoulder of Orion. I watched C-beams glitter
in the dark near Tannhauser Gate. All those moments will be
lost in time, like tears in rain ... Time to die ...
-Blade Runner -
================================================================
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
2004\07\06@173827
by
Peter Moreton
Joan, This is just how it is, I don't know why thay implemented it this way;
you have to write your own function to overcome this problem, using single
character I/O calls. Peter Moreton
> {Original Message removed}
2004\07\06@184901
by
Harold Hallikainen
I also wrote my own function to get around this "feature." It's real easy
to do by just copying their source code and modifying it. I created my own
file of usart functions that I call UART.c. I just call these when I want
a more logical result. Another function I rewrote, as I recall (I'm not at
work right now) is putcUSART so it would wait for the USART to be ready.
As I recall, putcUASRT just dumps the argument into the USART data
register.
Harold
> Joan, This is just how it is, I don't know why thay implemented it this
> way;
> you have to write your own function to overcome this problem, using single
> character I/O calls. Peter Moreton
>
>
>> {Original Message removed}
2004\07\07@042552
by
Alan B. Pearce
> Unfortunatelly 'putsUSART()' function "writes a string of
> characters to the
> USART including the null character" ("MPLAB C18 C Compiler
> Libraries") :-((
You could always modify their function to do it the way you want.
Certainly look at the code for it, and make sure the documentation is
correct. There is always the possibility that the documentation is
incorrect, and that the null is used to terminate the operation without
being transmitted.
--
http://www.piclist.com hint: The PICList is archived three different
ways. See http://www.piclist.com/#archives for details.
2004\07\07@115551
by
Joan Ilari
> You could always modify their function to do it the way you want.
>
> Certainly look at the code for it, and make sure the
> documentation is correct. There is always the possibility
> that the documentation is incorrect, and that the null is
> used to terminate the operation without being transmitted.
>
The null char is really transmitted. I saw it when debugging the program and
having a look at the hex chars received at the other side of the serial
line. It was then that I read the manual and found this (for me) nonsense
feature. I cannot think on an application where this null char could be of
interest !.
Joan
--
http://www.piclist.com hint: The PICList is archived three different
ways. See http://www.piclist.com/#archives for details.
More... (looser matching)
- Last day of these posts
- In 2004
, 2005 only
- Today
- New search...