Searching \ for '[PIC]: HiTech C serial routine' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=serial
Search entire site for: 'HiTech C serial routine'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: HiTech C serial routine'
2000\12\03@112922 by Andy N1YEW

picon face
Does anyone have HiTech C source for a RS232 Comms without a MAX232 or equivalent?

TNX
Andy N1YEW

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@131844 by Thomas C. Sefranek

face picon face
Andy N1YEW wrote:

> Does anyone have HiTech C source for a RS232 Comms without a MAX232 or equivalent?
>

Why would the choice of voltage level transport change the compiler source?
(You couldn't be asking for a simple logic inversion right?)

>
> TNX
> Andy N1YEW
>
> --
> http://www.piclist.com hint: PICList Posts must start with ONE topic:
> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
 *
 |  __O    Thomas C. Sefranek  spam_OUTtcsTakeThisOuTspamcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@141454 by Andy N1YEW

picon face
yes but...

their routine is hard to understand and i want to understand it and it needs
to do like 115.2 k

andy
{Original Message removed}

2000\12\03@150251 by Olin Lathrop

face picon face
> Does anyone have HiTech C source for a RS232 Comms without a
> MAX232 or equivalent?

Your question makes no sense.  The PIC can not produce RS-232 directly
because the voltage levels are different.  Therefore there needs to be some
sort of conversion between a PIC TX and RX line and the RS-232 lines.
However, none of this makes any difference to the compiler if you are using
the built in USART.  The PIC USART happens to have its signals inverted from
the RS-232 line, so whatever converter you use will need to perform an
inversion.  As long as this inversion is done, it is of no concequence to
the PIC code.  If you do a software UART, you have the option of dealing in
inverted levels or not, and then have to chose the appropriate conversion
hardware to get to RS-232.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, .....olinKILLspamspam@spam@embedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@151536 by Thomas C. Sefranek

face picon face
Andy N1YEW wrote:

> yes but...
>
> their routine is hard to understand and i want to understand it and it needs
> to do like 115.2 k
>

Andy,

I'd like to help, but I'm baffled by what your asking...
It seems you are making a moving target.
First you ask about RS-232 and MAX232 and C.
Now you say the C "is hard to understand" and you want to "do" 115.2 Kbaud.
Are these some how related?
Are you asking how to "do" Async. comm on a PIC?
(Setting baud rates?)
Are you asking how to do C?
Or are you asking how Hi(LOW)Tech C does Acync comm?  So you can... what?
(I am so sorry I blew my money on what other on this list said was a good
compiler!)


>
> andy
> {Original Message removed}

2000\12\03@152540 by Andy N1YEW

picon face
here is what i meant/mean

requirements:

155.2 kbs
w/o external components
half duplex receive and transmit

this clear things up?

Andy N1YEW
{Original Message removed}

2000\12\03@161451 by Bob Ammerman

picon face
> 155.2 kbs

I assume you mean 115.2, not 155.2!

> w/o external components

The PIC is TTL level. In addition, the built in UART's output is inverted.
This means you need some kind of converter/external components if you intend
to use the internal UART to talk to a PC or anything like that.

You can go with a direct TTL connection to another device that has inverted
TTL signals, like another PIC.

> half duplex receive and transmit

This helps performance wise.

> this clear things up?

Clear as mud.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@162117 by mike

flavicon
face
On Sun, 3 Dec 2000 13:24:30 -0500, you wrote:

>yes but...
>
>their routine is hard to understand and i want to understand it and it needs
>to do like 115.2 k
In which case you really ought to be doing it assembler - this sort of
bit-twiddly thing is usually much easier in assembler, and C is not
good at efficiently using things like carry flags.
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@164055 by Andy N1YEW

picon face
Oh. sorry see comments below

----- Original Message -----
From: "Bob Ammerman" <RAMMERMANspamKILLspamPRODIGY.NET>
To: <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Sent: Sunday, December 03, 2000 4:08 PM
Subject: Re: [PIC]: HiTech C serial routine


> > 155.2 kbs
>
> I assume you mean 115.2, not 155.2!

yes thats what i meant.


>
> > w/o external components
>
> The PIC is TTL level. In addition, the built in UART's output is inverted.
> This means you need some kind of converter/external components if you
intend
> to use the internal UART to talk to a PC or anything like that.
>

I want to use a 16f84 with TTL levels (which i have done in ASM but not C).

> You can go with a direct TTL connection to another device that has
inverted
> TTL signals, like another PIC.
>

True but I want to hook it to my PC

> > half duplex receive and transmit
>
> This helps performance wise.

It also makes it easier

>
> > this clear things up?
>
> Clear as mud.
>

mud is clear after everything settles out =)

Andy N1YEW
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@164836 by Randy Glenn

picon face
Look to the BASIC Stamp application notes at http://www.parallaxinc.com - they have
a schematic for hooking up to the serial port with only a resistor, IIRC.

-Randy Glenn

Randy_Glenn-at-tvo.org - PICxpert-at-home.com
PICxpert-at-yahoo.com - PICxpert-at-picxpert.com
           http://www.picxpert.com/

{Original Message removed}

2000\12\03@165703 by Spehro Pefhany

picon face
At 04:48 PM 12/3/00 -0500, you wrote:
>Look to the BASIC Stamp application notes at http://www.parallaxinc.com - they have
>a schematic for hooking up to the serial port with only a resistor, IIRC.

But the signals are inverted, I don't think you can use the internal UART
unless the signals are put right by inverters. This is aside from the signal
level issue.

Best regards,
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
EraseMEspeffspam_OUTspamTakeThisOuTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@182842 by Olin Lathrop

face picon face
> I am aware of this as I have coded RS232 in ASM.
>
> my code is called ser.asm and you may have seen it on the list before.
ikt
{Quote hidden}

OK, so what is the problem then?  If you understand all these issues then I
don't understand what you are asking.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinspamspam_OUTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@182847 by Olin Lathrop

face picon face
> requirements:
>
> 155.2 kbs
> w/o external components
> half duplex receive and transmit
>
> this clear things up?

No.  First, I assume you mean 115.2 Kbs.  Second, you can't do RS-232 using
a PIC USART without external components, and your baud rate is too high to
allow for a software implementation.  Are you asking about a private
communications channel that is not RS-232 but still uses the same timing?


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, @spam@olinKILLspamspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@190100 by Olin Lathrop

face picon face
> > You can go with a direct TTL connection to another device that has
> inverted
> > TTL signals, like another PIC.
> >
>
> True but I want to hook it to my PC

Then you will have to at least partially conform to the RS-232 standard.  At
the very least, this requires an inversion from the PIC lines, so it can not
be done without some sort of external hardware.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, KILLspamolinKILLspamspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\03@191150 by Sean H. Breheny

face picon face
Hi Andy,

Are you looking for a software implementation (bit banged) in C ?

I think that is possible,but it is probably best done in assembly (or
inline assembly in C). Olin, I did a quick calculation and for a 20Mhz PIC,
you would have about 40 instructions per bit at 115.2kbps. I don't know
which PIC we are talking about, but that sounds doable.

Sean

At 06:25 PM 12/3/00 -0500, you wrote:
{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\04@084347 by Olin Lathrop

face picon face
> I think that is possible,but it is probably best done in assembly (or
> inline assembly in C). Olin, I did a quick calculation and for a 20Mhz
PIC,
> you would have about 40 instructions per bit at 115.2kbps. I don't know
> which PIC we are talking about, but that sounds doable.

Yeah, you're right, that was a knee jerk reaction.  I remembered just barely
squeezing 9600 baud out of a software UART, but forgot that it was only
running with a 160KHz clock.

Unless this is an extremely low cost and high volume product, I would just
use the internal UART with an external converter like one of the Maxim
chips.

Now there would be a neat idea for Microchip!  How about a UART that
includes the charge pumps and level converters for direct RS-232 connection?
It seems about half my projects end up interfacing with the outside world
via RS-232.


*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spamBeGoneolinspamBeGonespamembedinc.com, http://www.embedinc.com

--
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


2000\12\04@090259 by mike

flavicon
face
On Sun, 3 Dec 2000 18:23:12 -0500, you wrote:

>> requirements:
>>
>> 155.2 kbs
>> w/o external components
>> half duplex receive and transmit
>>
>> this clear things up?
>
>No.  First, I assume you mean 115.2 Kbs.  Second, you can't do RS-232 using
>a PIC USART without external components,
>and your baud rate is too high to
>allow for a software implementation.
Not true (as long as you don't try doing it in C of course!),
depending on your clock rate you will have little to almost no
processing time left, but this may not matter.

--
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


2000\12\04@114424 by Andy N1YEW

picon face
I wrote a 38400 bps receive routine for a 4 MHz pic, but I haven't tried it
yet.  If you triple the clock and dont change the code that is 115.2 kbps on
a 12 MHz pic.

38400 is about the max speed for a 4 MHz pic.

Andy N1YEW
{Original Message removed}

2000\12\04@130537 by mike

flavicon
face
On Mon, 4 Dec 2000 08:39:36 -0500, you wrote:

>> I think that is possible,but it is probably best done in assembly (or
>> inline assembly in C). Olin, I did a quick calculation and for a 20Mhz
>PIC,
>> you would have about 40 instructions per bit at 115.2kbps. I don't know
>> which PIC we are talking about, but that sounds doable.
>
>Yeah, you're right, that was a knee jerk reaction.  I remembered just barely
>squeezing 9600 baud out of a software UART, but forgot that it was only
>running with a 160KHz clock.
>
>Unless this is an extremely low cost and high volume product, I would just
>use the internal UART with an external converter like one of the Maxim
>chips.
>
>Now there would be a neat idea for Microchip!  How about a UART that
>includes the charge pumps and level converters for direct RS-232 connection?
>It seems about half my projects end up interfacing with the outside world
>via RS-232.
Or at the very least allow the uart pins to be inverted - when talking
to PCs over short cables you just don't need drivers.
--
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


More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...