Searching \ for 'Serial Comms With the 16C84' 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: 'Serial Comms With the 16C84'.

Truncated match.
PICList Thread
'Serial Comms With the 16C84'
1996\11\11@053136 by efoc

flavicon
face
Hi all,

Firstly FLAME SHIELDS UP

Now I know this is probably a question that has been asked a thousand
times before but ..........

Does anybody have any idea how to code serial comms on the 16C84 and
more inportantly can tell me how, with code examples also please.

Thanks Peter.....

FLAME SHIELDS DOWN

--
==================================
= New Ideas come from those who  =
= didn't know it wasn't possible =
==================================

1996\11\11@113634 by icio culibrk

flavicon
face
SendTo: spam_OUTpiclistTakeThisOuTspammitvma.mit.edu

:: Baines <.....efocKILLspamspam@spam@CELTIC.CO.UK> :: wrote:

> Does anybody have any idea how to code serial comms on the 16C84 and
> more inportantly can tell me how, with code examples also please.
>
> Thanks Peter.....
>

Check at http://www.arne.si/~mauricio/pic.htm, if you can't access the
web, please, let me know and I'll send that to you via e-mail.

Regards,

mauricio

1996\11\12@022345 by Werner Terreblanche

flavicon
face
Baines <efocspamKILLspamCELTIC.CO.UK> wrote:

> Does anybody have any idea how to code serial comms on the 16C84 and
> more inportantly can tell me how, with code examples also please.

Baines

 There are a few example routines of how to do this in assembler on the
Microchip
Web page, but if you know a little bit of C, then I can really
recommend the CCS PCM C compiler.  Just as an example, the code to
output "Hello World!" on the serial port would then be as simple as
this:


#include <16C84.H>
#fuses   HS,NOPROTECT,NOWDT
#use delay(clock=4000000)
#use rs232(baud=9600,xmit=PIN_B0,rcv=PIN_B1)

main()
{
  printf("Hello World!");
}


What could be simpler than that!   :)  :)

Rgds
Werner
--
Werner Terreblanche   Tel +27 21 7102251   Fax +27 21 721278
.....wterrebKILLspamspam.....plessey.co.za (work) OR EraseMEwernerspam_OUTspamTakeThisOuTaztec.co.za  (home)

1996\11\12@030539 by efoc

flavicon
face
mauricio culibrk wrote:
>
> SendTo: piclistspamspam_OUTmitvma.mit.edu
>
> :: Baines <@spam@efocKILLspamspamCELTIC.CO.UK> :: wrote:
>
> > Does anybody have any idea how to code serial comms on the 16C84 and
> > more inportantly can tell me how, with code examples also please.
> >
> > Thanks Peter.....
> >
>
> Check at http://www.arne.si/~mauricio/pic.htm, if you can't access the
> web, please, let me know and I'll send that to you via e-mail.
>
> Regards,
>
> mauricio

Hi, thanks for the tip but I CANOT get access to the web from this
terminal so could you please email me the asm code.

Thanks Peter
--
==================================
= New Ideas come from those who  =
= didn't know it wasn't possible =
==================================

1996\11\12@030746 by efoc

flavicon
face
Werner Terreblanche wrote:
{Quote hidden}

Thanks for the tip but I do not have access to this compiler, My first
language is 'C' but my budget does not run into a 'C' compiler, I'm not
that wealthy :)))), If you know of a good public domain or cheap
shareware compiler that will do the job then can you please point me at
it or even email me the asm code to do the job .


Thanks Peter



--
==================================
= New Ideas come from those who  =
= didn't know it wasn't possible =
==================================

1996\11\12@083035 by Martin Darwin

flavicon
face
At 08:07 AM 11/12/96 +0000, you wrote:

[munch...]

>Thanks for the tip but I do not have access to this compiler, My first
>language is 'C' but my budget does not run into a 'C' compiler, I'm not
>that wealthy :)))), If you know of a good public domain or cheap
>shareware compiler that will do the job then can you please point me at
>it or even email me the asm code to do the job .

Try http://personal.eunet.fi/pp/jokinen/ for a 16c84 C compiler. It has all of
the basic operations but no fancy stuff like serial communications but it's
free.

Try the following code for serial out.  I don't guarantee that it will work but
it should give you some ideas.  Note: you will have to manually edit the
asm("movwf      0x00"); line in the output file because the compiler doesn't
properly do asm("").  BTW the assembly line is needed because the compiler
doesn't compile x_byte = (x_byte >> 1); properly.  A few bugs but otherwise
a good compiler.

MD


char i;
char j;
char temp3;
char temp4;
char k;

/* This function sends data (through a RS_232 chip) to a computer */
/* at 4800,8,N,1. The data to be sent is the first parameter.     */
/* This function uses the counter variables: i and j              */

put_byte(x_byte)
char x_byte;
{
       /* Send the start bit */

       i=8;
       j=67;                           /* 136/2 for 4800 */
       clearbit(PORTA,0);
       do {} while(--j);               /* Fast loop */

       /* Send the data */

       do
       {
               x_byte = (x_byte >> 1);

               asm("movwf      0x00");         /*    Compiler bug fix */

               if (bitset(STATUS,0))
                       setbit(PORTA,0);
               else
                       clearbit(PORTA,0);
               j=65;                           /* 134/2 for 4800 */
               do {} while(--j);               /* Fast loop */
       }
       while(--i);

       /* Send the stop bit */
       /* If possible waste 4 cycles here */
       j=70;                           /* 139/2 for 4800 */
       setbit(PORTA,0);
       do {} while(--j);               /* Fast loop */

}

main()
{
       TRISA = 0;
       k=0;
       while(1) {
               send_byte(k);
               k++;
       }
}

interrupt()
{
       retint();

}

--
Martin Darwin   a.k.a Rambo [Ctf] (see you at quake.mgl.ca)
spamBeGones721099spamBeGonespamuottawa.ca             3rd year Computer Engineering
http://aix2.uottawa.ca/~s721099         University of Ottawa
Clan Ctf - http://www.geocities.com/TimesSquare/3541/

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