Searching \ for 'RS232' 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/io/serials.htm?key=rs232
Search entire site for: 'RS232'.

Truncated match.
PICList Thread
'RS232'
1995\02\20@100344 by Bryan Crotaz

picon face
Why is the stop bit necessary?

My system reads serial by the following routine, called every 1/baudrate secs.

Is active_word flag high?
Yes: goto NEXT_BIT

START_BIT
Look at input line.
Is it high?
No: Exit routine
Yes: Set active_word flag, set rx_bits=no. of bits in word
Exit routine

NEXT_BIT
Look at input line.
Shift bit into rx_data store
Decrement rx_bits
rx_bits=0?
No: Exit routine
Yes: End of word
Clear active_word flag
Set received_word flag
Exit routine

By this method, the next start bit can come immediately after the last
data bit.
Problems occur if the routine happens to be called on the transition
edges of the data.  I`m already using the edge trigger bit on RB0 for
another serial comms system, and have some maths running "in the
background".  How can I force it to read the centre of the pulses?

Bryan
--
spam_OUTb.crotazTakeThisOuTspamic.ac.uk
---------------------------------
TECHNICAL MANAGER
Student Television Of Imperial College
Beit Quad, Prince Consort Road
London  SW7 2BB
Tel. 0171-594-8104
Fax. 0171-594-8065 Attn. STOIC { NOTE NEW FAX NUMBER }

1995\02\20@113711 by Adrian Godwin

flavicon
face
> Why is the stop bit necessary?
>
> My system reads serial by the following routine, called every 1/baudrate secs
> .
> ......
> By this method, the next start bit can come immediately after the last
> data bit.

Yes, but you can't recover from an error - the stop bit allows you
to search for a guaranteed transition when you're out of sync. You still
might misinterpret a data transition as the start bit,  but you'll
soon see another error (a framing error in async nomenclature) and
that can cause you to look for a valid stop bit again. Sooner or later,
you'll resync correctly.

> Problems occur if the routine happens to be called on the transition
> edges of the data.  I`m already using the edge trigger bit on RB0 for
> another serial comms system, and have some maths running "in the
> background".  How can I force it to read the centre of the pulses?

Look for transitions as well as sampling levels - when you detect a
transition, rearrange your bit-time timer so that the next level
sampled is 1/2 a bit-time later. A more sophisticated algorithm would
slide the sample points in response to edge positions (instead of
jumping) so that transitions due to noise would cause minimal
disturbance to your timing. This is the way hardware UARTs work, often
with a counter running at 16x bitrate to define the sample time. The
value of the counter is adjusted when a transition occurs to help
keep the transitions 1/2 a bit-time away from the sampling point.
It's a digital implementation of a phase-locked loop.

-adrian

1995\02\21@082722 by Edward Cheung

flavicon
face
>From:         Charles Manning <.....manningcKILLspamspam@spam@NZ.DIALOGIC.COM>
>* Ensuring correct start bit detection. The stop bit is high and the
>next start bit is low, thus providing a reliable transition.

I just finished my first project on PIC programming, a serial in/out
library.  During my testing it became apparent to me that my Mac uses
a level '1' (-12Volts) as the quiescent RS232 level.  Start bits are
'0' (12Volt), and the data bit is normal (thus an ASCII 'U' is
01010101, LSB sent first).  After that I see a '1' as stop bit, and
the line remains at the quiescent level of '1'.

Can anyone confirm this?

I went ahead and implemented my RS232 to match the above discription,
and the routines now work just fine.

>From:         Bryan Crotaz <b.crotazspamKILLspamIC.AC.UK>
>Problems occur if the routine happens to be called on the transition
>edges of the data.  I`m already using the edge trigger bit on RB0 for

In my system, I setup the RTCC to get me 19,200 interrupts/sec.  I am
thus able to sample a 9600 bit/sec stream twice per bit.  As you pointed
out, this may lead to cases where the PIC samples at the transition of
a bit.  I have not seen this happen during testing.  If needed, I can
change the routines to three interrupts per bit to guarantee sampling
away from an edge.

+---------------------------------------+-----------------------------------+
|          Edward Cheung, Ph.D.         |  The opinions expressed herein    |
|Satellite Servicing Robotics Laboratory|    do not necessarily reflect     |
|    NASA Goddard Space Flight Center   |       those of my employers'      |
|         Code 714.1, Bldg T11B         |                                   |
|          Greenbelt, MD 20771          |                                   |
|   301-286-1269(office) 286-1717(fax)  |  My next book:                    |
| Internet: .....oadebcKILLspamspam.....robots.gsfc.nasa.gov | Statistics, Demos and Other Lies  |
+---------------------------------------+-----------------------------------+

1995\02\21@085659 by Byron A Jeff

face picon face
>
> >From:         Charles Manning <EraseMEmanningcspam_OUTspamTakeThisOuTNZ.DIALOGIC.COM>
> >* Ensuring correct start bit detection. The stop bit is high and the
> >next start bit is low, thus providing a reliable transition.
>
> I just finished my first project on PIC programming, a serial in/out
> library.  During my testing it became apparent to me that my Mac uses
> a level '1' (-12Volts) as the quiescent RS232 level.

Yup. This is called a mark. It's the idle state for an RS-232 Line.

> Start bits are '0' (12Volt),

Again correct.
> and the data bit is normal (thus an ASCII 'U' is
> 01010101, LSB sent first).  After that I see a '1' as stop bit,
> and  the line remains at the quiescent level of '1'.

The stop bit it important because if you're sending consecutive characters
and the MSB of the first charater is a 0, then there would be no transition
between characters. With a stop bit of 1 and and start of 0 a transition is
guranteed between characters.

>
> Can anyone confirm this?

Exactly Correct.

{Quote hidden}

What UART hardware typically does is sample in the middle of the cell only
because it's the least likely place to have a transition.

My master's student implemented as serial routine set on a 16C84. It works
reliably at 19200 and probably could operate at 38400. However it's half
duplex only and uses delays instead of the RTCC. It works fine for her
applications though.

BAJ


'RS232'
1995\09\30@033504 by FICK, N, N, FCKNOR001
flavicon
picon face
Hi,

I would like to know where on the net I could find info on RS232. I
wish to interface a computer to a PIC16C74 via a serial link.  Thanks
in advance.

Norman


'RS232'
1995\10\01@044540 by David Tait
flavicon
face
Hi,

> I would like to know where on the net I could find info on RS232. I
> wish to interface a computer to a PIC16C74 via a serial link.  Thanks
> in advance.

Anybody wishing to know a bit more about RS232 and PC RS232 programming
should take a look at Christian Blum's FAQ.  It's available from numerous
sites but probably the most up-to-date copy can be found here:

ftp://ftp.phil.uni-sb.de/pub/chris/The_Serial_Port

There are a few other files in /pub/chris that might be worth a look
too.

David
--
@spam@david.taitKILLspamspamman.ac.uk


'RS232'
1996\04\06@064103 by nogueira
flavicon
face
petit jc wrote:
>
> I would like to connect a pic (13c84) to the serial port.
> The problem is that I don't want to use any battery and no converter
> 0/5v +12v/-12v.
> I would like to use the line TX at the level (-12 v) and so I need to
> put a regulator between TX and GND. But what about the other lines? How
> can I obtain the correct protocol? It seems that a mouse works like that
> (TX/GND -12v) but I can't find any schematic of a mouse...
> Thanks for response.
> KILLspampetitjKILLspamspamesiee-amiens.fr


Hi Jc, I don't know why you want to use the TX insted of RTS.
well, this is a circuit that connect to PC via serial port, use no other
power supply than the RS-232 and works up to 19200bps. The PIC can receive
and transmit data.
If you need code, I can send to you, just ask me.

Octavio
RemoveMEnogueiraTakeThisOuTspammandic.com.br


          list n=78, p=PIC16C84, r=HEX
;***************************************************************************
          TITLE "RS232C Interface"
;
;    Comments: PIC-16C84/PC RS232 Interface
;          By: Terry Rudersdorfer, AScT
;        Date: Aug/94
;     Revised: Sep/94 eliminate transistor, diode and resistor on RX
;     Revised: Oct/94 added test led for do something test
;
;       Fuses: XT or HS and PWRTE enabled
;
; This design provides;
;     - full duplex 2400 Baud with 8 bits no parity 1 stop using
;       a standard 5.066 MHz communication xtal.
;     - only 3 resistors to provide an RS232 Tx/Rx electrical interface
;     - power is obtained from the standard RS232 control leads.
;       (RS232 O/P's can sink/source 10mA; this circuit uses < 5mA.)
;
; Simple RS232C - PC to PIC Interface     Aug/94      T. Rudersdorfer, AScT
;  revised Sep/94
;
;   1 - 470 ohm   short circuit current limit
;   1 - 10k       open collecter pull down
;   1 - 47k       power up pull up
;   1 - 470k      injection current limit
;   2 - 15pf      oscillator stabilization
;   1 - .1uf      decouple PIC and regulator
;   1 - 10uf      voltage stabilization
;   1 - 5.0688MHz standard communication xtal
;   1 - 1N4150    reverse voltage blocking diode
;   1 - 78L05     5V low power regulator (100mA Max)
;   1 - 16C84     PIC
;   1 - LED       do something test led
;   1 - 2k7       do something current limit for test led
;
; PC  DTE  DCE
;
;  RX<(3)--(3)-/\/\/\/-----------------------------+--/\/\/\/----+
;                470                               |    10k      |
;                       |\ |                       |            ///
;        +-----/\/\/\/--| >|---------------------+ |
;        |       2k7    |/ |   ---------------   | |
;        |              LED   | 1     U   RA1 |--+ |
;        |   ^ +5V            |           RA0 |----+
;        |   |                | ____  1  Osc1 |------------------+
;        +---+-/\/\/\/--------| MCLR  6  Osc2 |------+           |
;                47k    +-----| Vss   C   Vdd |--+   |     _     |
;                       |  +--| RB0   8       |  |   +---||_||---+
;                      /// |  |       4       |  |   | 5.0688MHz |
;  TX>(2)--(2)-/\/\/\/-----+  |               |  |  _|_         _|_
;               470k          |_______________|  |  ___15pf     ___15pf
;                                                |   |           |
;                  1N4150        _____    ^ +5V  |  ///         ///
;                   |\ |        |     |   |      |
; RTS>(4)--(4)-+----| >|----+---|78L05|---+------+
;              |    |/ |    |  1|_____|3  |
; CTS<(5)--(5)-+           _|_     |2    _|_
;              |           ___10uf |     ___.1uf
; DSR<(6)--(6)-+            |      |      |
;                          ///    ///    ///
; GND (7)--(7)-+
;              |
;             ///
;
; RS232 RX circuit background:
;    Based on AN521 in the 1993 Embedded Handbook; PIC I/O pins can handle
;    +/- 500uA of continuous injected current. This means voltages greater
;    than VDD and VSS CAN BE used as long as adequate current limiting is
;    provided. My original RX input design isolated the PIC by using an
;    extra transistor, diode and resistor. This can be eliminated by using
;    a large enough resistor value in series to the PIC I/O Pin. RS232
;    voltage levels can be up to +/- 15V, therefore, a 470k resistor provides
;    an adequate current limit of 32uA (the same current used in AN521).
;
; RS232 TX circuit background:
;    Researching specification sheets for RS232 receivers like the 1489,
;    reveals that they do not require bipolar voltages to operate. The
;    1489 in fact clips all -ve signals to ground, therefore only requiring
;    +ve and ground input levels.
;
;

1996\04\06@064103 by nogueira

flavicon
face
petit jc wrote:
>
> I would like to connect a pic (13c84) to the serial port.
> The problem is that I don't want to use any battery and no converter
> 0/5v +12v/-12v.
> I would like to use the line TX at the level (-12 v) and so I need to
> put a regulator between TX and GND. But what about the other lines? How
> can I obtain the correct protocol? It seems that a mouse works like that
> (TX/GND -12v) but I can't find any schematic of a mouse...
> Thanks for response.
> spamBeGonepetitjspamBeGonespamesiee-amiens.fr


Hi Jc, I don't know why you want to use the TX insted of RTS.
well, this is a circuit that connect to PC via serial port, use no other
power supply than the RS-232 and works up to 19200bps. The PIC can receive
and transmit data.
If you need code, I can send to you, just ask me.

Octavio
TakeThisOuTnogueiraEraseMEspamspam_OUTmandic.com.br


          list n=78, p=PIC16C84, r=HEX
;***************************************************************************
          TITLE "RS232C Interface"
;
;    Comments: PIC-16C84/PC RS232 Interface
;          By: Terry Rudersdorfer, AScT
;        Date: Aug/94
;     Revised: Sep/94 eliminate transistor, diode and resistor on RX
;     Revised: Oct/94 added test led for do something test
;
;       Fuses: XT or HS and PWRTE enabled
;
; This design provides;
;     - full duplex 2400 Baud with 8 bits no parity 1 stop using
;       a standard 5.066 MHz communication xtal.
;     - only 3 resistors to provide an RS232 Tx/Rx electrical interface
;     - power is obtained from the standard RS232 control leads.
;       (RS232 O/P's can sink/source 10mA; this circuit uses < 5mA.)
;
; Simple RS232C - PC to PIC Interface     Aug/94      T. Rudersdorfer, AScT
;  revised Sep/94
;
;   1 - 470 ohm   short circuit current limit
;   1 - 10k       open collecter pull down
;   1 - 47k       power up pull up
;   1 - 470k      injection current limit
;   2 - 15pf      oscillator stabilization
;   1 - .1uf      decouple PIC and regulator
;   1 - 10uf      voltage stabilization
;   1 - 5.0688MHz standard communication xtal
;   1 - 1N4150    reverse voltage blocking diode
;   1 - 78L05     5V low power regulator (100mA Max)
;   1 - 16C84     PIC
;   1 - LED       do something test led
;   1 - 2k7       do something current limit for test led
;
; PC  DTE  DCE
;
;  RX<(3)--(3)-/\/\/\/-----------------------------+--/\/\/\/----+
;                470                               |    10k      |
;                       |\ |                       |            ///
;        +-----/\/\/\/--| >|---------------------+ |
;        |       2k7    |/ |   ---------------   | |
;        |              LED   | 1     U   RA1 |--+ |
;        |   ^ +5V            |           RA0 |----+
;        |   |                | ____  1  Osc1 |------------------+
;        +---+-/\/\/\/--------| MCLR  6  Osc2 |------+           |
;                47k    +-----| Vss   C   Vdd |--+   |     _     |
;                       |  +--| RB0   8       |  |   +---||_||---+
;                      /// |  |       4       |  |   | 5.0688MHz |
;  TX>(2)--(2)-/\/\/\/-----+  |               |  |  _|_         _|_
;               470k          |_______________|  |  ___15pf     ___15pf
;                                                |   |           |
;                  1N4150        _____    ^ +5V  |  ///         ///
;                   |\ |        |     |   |      |
; RTS>(4)--(4)-+----| >|----+---|78L05|---+------+
;              |    |/ |    |  1|_____|3  |
; CTS<(5)--(5)-+           _|_     |2    _|_
;              |           ___10uf |     ___.1uf
; DSR<(6)--(6)-+            |      |      |
;                          ///    ///    ///
; GND (7)--(7)-+
;              |
;             ///
;
; RS232 RX circuit background:
;    Based on AN521 in the 1993 Embedded Handbook; PIC I/O pins can handle
;    +/- 500uA of continuous injected current. This means voltages greater
;    than VDD and VSS CAN BE used as long as adequate current limiting is
;    provided. My original RX input design isolated the PIC by using an
;    extra transistor, diode and resistor. This can be eliminated by using
;    a large enough resistor value in series to the PIC I/O Pin. RS232
;    voltage levels can be up to +/- 15V, therefore, a 470k resistor provides
;    an adequate current limit of 32uA (the same current used in AN521).
;
; RS232 TX circuit background:
;    Researching specification sheets for RS232 receivers like the 1489,
;    reveals that they do not require bipolar voltages to operate. The
;    1489 in fact clips all -ve signals to ground, therefore only requiring
;    +ve and ground input levels.
;
;


'RS232'
1996\11\26@073035 by Clewer,Brian
flavicon
face
Hi all,
    Can anyone help me with my communications to my pc to and from my
16c84?  What I need is the timings in micro seconds of the data transfer
between the bits sent (9600, N 8 1).  It will be a 3 wire link (Tx, Rx &
Gnd).  I will need to poll for the data in the middle of each bit.

    Thanks for your help in advance,
         Brian.

1996\11\26@105915 by nogueira

flavicon
face
Clewer,Brian wrote:
>
> Hi all,
>      Can anyone help me with my communications to my pc to and from my
> 16c84?  What I need is the timings in micro seconds of the data transfer
> between the bits sent (9600, N 8 1).  It will be a 3 wire link (Tx, Rx &
> Gnd).  I will need to poll for the data in the middle of each bit.
>
>      Thanks for your help in advance,
>           Brian.

The bit time is 1/9600 = 104us

Octavio
--
========================================================
Octavio Nogueira
e-mail:   RemoveMEnogueiraspamTakeThisOuTmandic.com.br
homepage: http://ourworld.compuserve.com/homepages/tato
voice/fax: +55 11 240-6474
"ProPic" The first Production PIC Programmer running in
Windows and under US$ 20.00.
========================================================

1996\11\26@155558 by Brooke

flavicon
face
Clewer,Brian wrote:
>
> Hi all,
>      Can anyone help me with my communications to my pc to and from my
> 16c84?  What I need is the timings in micro seconds of the data transfer
> between the bits sent (9600, N 8 1).


Brian:

You might want to get the file "ADVDEMO2.ZIP" from the Microchip web
site
and use the ADVUART program.  This is an asynchronous half-duplex serial
bit banger that automatically figures out the timing info based on the
baud
rate and osc frequency (does NOT use any interrupts).
It is working great for me.

Have Fun,
Brooke

1996\11\27@165410 by J. Cabral

flavicon
face
part 0 7114 bytes

I send in attach the code I devellop, it is not very well programmed because
it was "develloped" same years ago!

If you want interrupt driven rotines you will have to use portb (wake-up) and
blow up (use) a timer to generate the delays!

; -------------------------------------------
; pic defs - file:pic16c64.h
; -------------------------------


#define ResetVector 0000h
#define IntVector 0004h
#define TRUE 1
#define FALSE 0
       CBLOCK  0x00                    ; Banco 0
       indf
       tmr0
       pcl
       status
       fsr
       porta
       portb
       portc
       portd
       porte
       pclath
       intcon
       pir1
       ENDC

       CBLOCK  0x0E
       tmr1l
       tmr1h
       t1con
       tmr2
       t2con
       sspbuf
       sspcon
       ccpr1l
       ccpr1h
       ccp1con
       ENDC

;       CBLOCK  0x81
;       option
;       ENDC

       CBLOCK  0x85                    ; Banco 1
       trisa
       trisb
       trisc
       trisd
       trise
       ENDC

       CBLOCK  0x8C
       pie1
       ENDC

       CBLOCK  0x8E                    ; Banco 1
       pcon
       ENDC

       CBLOCK  0x92                    ; Banco 1
       pr2
       sspadd
       sspstat
       ENDC

#define c       status,0
#define carry   status,0
#define dc      status,1
#define z       status,2
#define zero    status,2
#define rp0     status,5

#define rbif    intcon,0
#define intf    intcon,1
#define rtif    intcon,2
#define rbie    intcon,3
#define inte    intcon,4
#define rtie    intcon,5
#define peie    intcon,6
#define gie     intcon,7

#define tmr1if  pir1,0
#define tmr2if  pir1,1
#define ccp1if  pir1,2
#define sspif   pir1,3
#define pspif   pir1,7
#define rtcc    tmr0
#define tmr1on  t1con,0

#define tmr1ie  pie1,0
#define tmr2ie  pie1,1
#define ccpie   pie1,2
#define sspie   pie1,3
#define pspie   pie1,7








;-----------------------------------------------
; File:Com232.h
; Definigues necessarias ao COM232.ASM
;-----------------------------------------------


EBaudBit equ 168 ;1/9600 bps=104.166us =>(10+3*x)*200ns=104.166us
EBaudSB  equ 171 ;(8+3*x)*200ns=104.166us;
RBaud equ 169
RBaud05 equ 64

       CBLOCK 0x20
        Cont
        Dados
        DelayCnt
        Aux
       ENDC

       #define Tx porta,0
       #define Rx porta,1
       #define RxSel porta,2   ; Selecgco de recepgco
       #define TxSel porta,3   ; Selecgco de transmissco
       #define CD porta,4      ; carrier detect
       #define TxPC porta,5    ; Tx e Rx para comunicagco com PC
       #define RxPC portc,7    ;




; ---------------
; communication rotines
; File: com232.asm
;----------------






       ; Necessita de 3 registos : Cont,Dados e DelayCnt
       ; Invocar ConfigRS232 antes de chamar Enviar ou Receber

ConfigRS232
               bsf     rp0
               bcf     TxPC
               bsf     RxPC
               bcf     rp0
               clrf    intcon
               bsf     TxPC
               ; determina a chegada de mais mensagens
               bcf     tmr1ie          ; impede ints do timer 1
               bcf     tmr1if
               clrf    tmr1h
               clrf    tmr1l
               clrf    t1con
               return



EnviarPC
               bcf     rp0
               bcf     c
               movlw   8
               movwf   Cont
               bcf     TxPC        ; Envia Start Bit
               call    EDelaySB    ; Espera tempo necessario ao Start Bit
EnvSegPC
               rrf     Dados,1     ; Envia 1: LSB
               btfsc   carry       ; Verifica se o bit i 1 ou 0
               bsf     TxPC
               btfss   carry
               bcf     TxPC
               call    EDelayBit   ; Espera pelo tempo de 1 bit
               decfsz  Cont,1      ; N: de bits de dados
               goto    EnvSegPC
EnvStopPC
               nop                 ; acertar tempo 8' bit
               nop
               bsf     TxPC        ; Envia Stop Bit
               call    EDelayBit   ; Espera o tempo necess rio
               return



EDelayBit
               movlw   EBaudBit
               goto    EsaveBaud
EDelaySB
               movlw   EBaudSB
EsaveBaud
               movwf   DelayCnt
Erep
               decfsz  DelayCnt,1
               goto    Erep
               return



ReceberPC
               bcf     rp0
               bcf     c
               clrf    Dados
               movlw   8
               movwf   Cont
Receber2PC
               btfss   RxPC            ; polling a espera de caracter
               btfsc   RxPC            ; start bit i zero
               goto    Receber2PC
RecStartPC
               bcf     gie             ; impede interrupgues
               call    RDelay05        ; esperar tempo de 1/2 Bit
               btfsc   RxPC            ; verificar se e mesmo Start Bit ou
               goto    Receber2PC      ; se e ruido
RecSegPC
               call    RDelay          ; esperar tempo de 1 Bit
               btfsc   RxPC            ; verificar se o bit recebido i 1 ou 0
               bsf     carry           ; o bit recebido i 1
               btfss   RxPC            ; verificar se o bit recebido i 1 ou 0
               bcf     carry           ; o bit recebido i 0
               rrf     Dados,1         ; colocar o bit recebido no byte de
dados
               decfsz  Cont,1
               goto    RecSegPC
RecStopPC
               call    RDelay          ; esperar tempo de 1 Bit pelo Stop Bit
               btfss   RxPC            ; verificar se e o Stop Bit
               goto    ReceberPC       ; nao e o Stop Bit. Ha erro!
               movf    Dados,0         ; caracter recebido esta em W e em Dados
               bsf     gie
               return

RDelay05
               movlw   RBaud05
               movwf   DelayCnt
               goto    Wait
RDelay
               movlw   RBaud
               movwf   DelayCnt
Wait
               decfsz  DelayCnt,1
               goto    Wait
               return


; --------------------
; Main loop
; --------------------





       LIST p=16C64,r=DEC
       TITLE "RS-232 ECHO"
       EXPAND

       include "pic16c64.h"
       include "com232.h"

       ;******* Definigco dos parbmetros RS-232 ********

       org ResetVector
       goto Main

       org IntVector
       retfie


Main:
       IFDEF __16C74A   ; for 16C74A - porta as I/O digital lines
         bsf   rp0
         movlw 7
         movwf 09fh
         bcf   rp0
       ENDIF
       call    ConfigRS232

       ; Sends string "JMC" to PC

       movlw   'J'
       movwf   Dados
       call    EnviarPC
       movlw   'M'
       movwf   Dados
       call    EnviarPC
       movlw   'C'
       movwf   Dados
       call    EnviarPC
       movlw   ' '

Loop:
       call    ReceberPC       ; receive from PC
       call    EnviarPC        ; echo to PC
       goto    Loop

       include "com232.asm"

       end


'RS232'
1998\01\05@175843 by Alessandro Zummo
flavicon
face
I need a fast and very reliable Rs232 rtx routine for
the C84.. anyone can help me?

--

  - *Alex* -

     (azummoEraseMEspam.....ita.flashnet.it)


'RS232'
1998\04\23@133645 by Istvan, Retaller
flavicon
face
Message-Id: 14086_ha5kfu
From: ha5bwh@ha5kfu.#bp.hun.euro (Istvan, Retaller)
To: EraseMEpiclistspammitvma.mit.edu

Joe Little writes:

    Remember PICS UARTS require inverters on both the TX and RX pins,

    bitbanging with general purpose pins do not.



You are right, Joe, I forgot to mention that my application runs on

'5x family, so I didn't need any inverter. I think connecting RX and

TX pins via appropriate inverters, the mentioned two resistor is

enough for connecting to PC.



Istvan, RemoveMEha5bwhEraseMEspamEraseMEha5kfu.sch.bme.hu


'rs232'
1999\01\19@072432 by Howard
flavicon
face
Hellp Pic'ers.
I realise that there has probably been thousands of words on the RS232
subject here in the past.
Unfortunatley, I wasn't interested then, but I am now!
I've searched the archives for info to no avail.
Problem:
I want to send a couple of bytes every few minutes for a 16F84 to a
Pentium Serial port, and file the bytes. (random access or Sequential -
doesn't matter!)  (I vagueley remember something about Pentiums giving
trouble in this regard)
I read up on "Interfacing the Serial Port RS232" by
http://www.snet.com.au/~cpeacock, and althoug I understand it, I can;t get it
to work.  The article uses C as a language, which I know nothing about -
I'm a Basic lad.  I read Microchips article, "implementation of an
Asynchronous Serial I/O, and understood that, but it gave little to the
PC end.
I thought a null modem setup would work, and wrote (copied) a short
routine in QBasic which is supposed to work with Stamps. (I couldn't get
it to work with a Stamp either!)
VisBasic has serial routines but really, to be honest, it's far to
complicated for the job here.  Also, to be portable, a VisBasic would
need to be "installed" to the host PC.
I think my problem is at the PC end.   CRO waveforms from the pic look
OK.  I've checked the routine a million times.  I've tried using a MAX
232 and I've tried not using it.  It's gotta be the PC end!
Questions:
Is there a quirk with Pentiums?  Should null modem setup work?  (one way
only - pic to PC)  suggested reading?
thanks - sorry to be so long winded.

1999\01\19@092410 by Ralph Stickley

flavicon
face
Try Hyperterminal first....split the problem in half, verify that the data
being sent is the right baud rate, right voltage levels etc. (if you're
sending binary data instead of ASCII data I'd go back to an old DOS terminal
program like Qmodem that displays all data in hex :-))  Hopefully someone
can suggest a program that works in windoze that us old-timers could upgrade
to oneday...

Any terminal program should allow you to capture the data and store it to
disk. Good luck

Howard wrote:

{Quote hidden}

1999\01\19@103339 by myke predko

flavicon
face
Good advice from Ralf.

I would also ask, how are you wiring the port?  From what you are writing, I
suspect that you don't have the handshaking lines wired correctly.

When in doubt, on the PC side short: DTR-DSR and CTS-RTS

Good luck,

myke

{Quote hidden}

Go on the drive of your life, this week in the book room:

http://www.myke.com/Book_Room/book1a.htm

Now Available!  "Programming and Customizing the 8051 Microcontroller".
Find out more at:

http://www.myke.com/My_Books/pac8051.htm

1999\01\20@065542 by Howard

flavicon
face
myke predko wrote:
>
> Good advice from Ralf.
>
> I would also ask, how are you wiring the port?  From what you are writing, I
> suspect that you don't have the handshaking lines wired correctly.
>
> When in doubt, on the PC side short: DTR-DSR and CTS-RTS
>
> Good luck,
>
> myke
>
Thanks guys.
However.......
Hyperterminal!!!
Assuming a null modem termination is correct (and I am sure it is)
I am a trifle confused with the rate.
Bit length = 1 over Baud, result in seconds (Microchip "Implementation
of the As Ser I/O) soooo... 2400 Baud = 416uS bit length.  Soooo... One
second divided by .000416 = 2403.  Same same!  I always thought, and I
may be in error, that a "baud" was a "character" in the old RTTY days.
Here it seems "Baud" is "Bits per second"  Izzatso?
Hyperterminal seems a trifle confused with me too!
It seems very interested in "capturing" text to file, or "receivinf a
file" (and then asks damn fool questions like what modem protocol I want
to use!  There ain't no modem, I told it!  so, no modem, no protocol, no
receiving files, which I OK by me.  I want a character at a time!!!
I am sending one character (72) which is "H" over and over, with a start
bit and a stop bit and idle for a few mS's than start H Stop etc.
Should thisn appear on Hypertext (Hypertext?? Hyperterminal!) screen as
the character is received, or am I waaaayyyy off the beam.
I'd be happy to see a string og H's  a string of 72's or anything!!!





{Quote hidden}

1999\01\20@074513 by Michael Rigby-Jones

flavicon
face
<snip>

> However.......
> Hyperterminal!!!
> Assuming a null modem termination is correct (and I am sure it is)
> I am a trifle confused with the rate.
> Bit length = 1 over Baud, result in seconds (Microchip "Implementation
> of the As Ser I/O) soooo... 2400 Baud = 416uS bit length.  Soooo... One
> second divided by .000416 = 2403.  Same same!
>
Errm it's fairly basic math that 1/(1/X) is going to be X !

> I always thought, and I
> may be in error, that a "baud" was a "character" in the old RTTY days.
> Here it seems "Baud" is "Bits per second"  Izzatso?
>
In this case Bits Per Second is what is meant.  Baud is tricky.  Sometimes
it's the same as bits per second, sometimes not.  It's actually Symbols per
second in modem terminology, and a symbol can contain more than 1 bit.

{Quote hidden}

Hyperterminal is not the most friendly application to use for simple RS232
comms without a modem.  It insists on creating a connection profile.  The
old Win 3.1 terminal was much easier to use.

Just make sure that in the setup, you specify "Direct to Comx" where x is
the com port you want to use. Click on the configure button and select the
desired bit rate and start/stop bits and flow control (probably none for
your aplication) and click ok. If you are sending valid RS232 to the correct
com port, then characters should start appearing as soon as you click OK.

If you want to capture text, all you have to specify is the name of the file
you want it written to, no protocols are needed.

Unfortunately you can't configure Hyperterminal to display hex so you'll
just get a bunch of "H"'s (if it's working).  If you need hex code display
there are some shareware terminal emulators that may do this.

Regards

Mike Rigby-Jones
RemoveMEmrjonesspam_OUTspamKILLspamnortelnetworks.com

<snip>

1999\01\20@121929 by myke predko

flavicon
face
Hi Howard,

Mike did most of the replies, but I have a couple of comments:

>Assuming a null modem termination is correct (and I am sure it is)

If it is correct, you should be able to short pins 2 and 3 together and when
you send data on the serial port, it should appear on the Hyperterminal
screen.  If it doesn't, then the handshaking lines are not correct.

Ideally, go into "Hyperterminal" Properties and turn off "Handshaking".

Before connecting the PICMicro up, make sure you understand what you are
doing well enough to be able to loop back characters.

<SNIP Bit Rates>

>Hyperterminal seems a trifle confused with me too!
>It seems very interested in "capturing" text to file, or "receivinf a
>file" (and then asks damn fool questions like what modem protocol I want
>to use!  There ain't no modem, I told it!  so, no modem, no protocol, no
>receiving files, which I OK by me.  I want a character at a time!!!

You should start with "Direct" and just go from there.  When I create a new
one, I use "Direct to Com#" with no handshaking.  If you specify anything
else, you're gonna get prompted for modem information.

>I am sending one character (72) which is "H" over and over, with a start
>bit and a stop bit and idle for a few mS's than start H Stop etc.
>Should thisn appear on Hypertext (Hypertext?? Hyperterminal!) screen as
>the character is received, or am I waaaayyyy off the beam.
>I'd be happy to see a string og H's  a string of 72's or anything!!!

Check the connections and get Hyperterminal working as you would expect.
When you are ready for the PC, even if you are sending data incorrectly, you
should get something on the screen.

Good luck and let me know if you have any more problems,

myke

This week's books, first find out what I don't like about Michael Eisner's
"Work in Progress" and then what I did like about P.T. Deutermann's "Zero
Option":

http://www.myke.com/Book_Room/book1a.htm

Now Available!  "Programming and Customizing the 8051 Microcontroller".
Find out more at:

http://www.myke.com/My_Books/pac8051.htm

1999\01\21@065259 by Howard

flavicon
face
Mike and Myke

Thanks for the info.  I know now what I should get, which is 1/2 the
problem.
I can't get back to it for a few days, but when I get it to go with
Hyperterminal, I'll let you know.
Of course, then, I've gotta write same basic to do the same.
regards Howard.

1999\01\22@145821 by Dal Wheeler

picon face
Howard <RemoveMEbrahTakeThisOuTspamspamULTRA.NET.AU>wrote:

>However.......
>Hyperterminal!!!
>Assuming a null modem termination is correct (and I am sure it is)
>I am a trifle confused with the rate.
>Bit length = 1 over Baud, result in seconds (Microchip "Implementation

I'm sure anyone that has messed with Hyperterminal has noticed this, but
if you are to change the com settings (parity, baud, etc.)- you must
quit/save and reload for the settings to take effect.  You would'nt
believe how much time I've wasted because of this silly thing.

EraseMEwheedalspamspamspamBeGoneisu.edu

1999\01\22@151527 by myke predko

flavicon
face
Dal Wheeler wrote:
>I'm sure anyone that has messed with Hyperterminal has noticed this, but
>if you are to change the com settings (parity, baud, etc.)- you must
>quit/save and reload for the settings to take effect.  You would'nt
>believe how much time I've wasted because of this silly thing.

Actually, all you have to do is disconnect, change your parameters and then
reconnect.  You don't have to quit/save and reload during debugging at all.

myke

This week's books, first find out what I don't like about Michael Eisner's
"Work in Progress" and then what I did like about P.T. Deutermann's "Zero
Option":

http://www.myke.com/Book_Room/book1a.htm

Now Available!  "Programming and Customizing the 8051 Microcontroller".
Find out more at:

http://www.myke.com/My_Books/pac8051.htm

1999\01\26@192544 by felix centeno

flavicon
face
If some one need a software there are a shareware in Download.com called
Comshow.exe that you can configure to access serial ports and send or recive
a word or string of characters ....


-----Mensaje original-----
De: myke predko <RemoveMEmykeKILLspamspamPASSPORT.CA>
Para: PICLISTSTOPspamspamspam_OUTMITVMA.MIT.EDU <spamBeGonePICLISTSTOPspamspamEraseMEMITVMA.MIT.EDU>
Fecha: Miircoles, 20 de Enero de 1999 01:19 p.m.
Asunto: Re: rs232


>Hi Howard,
>
>Mike did most of the replies, but I have a couple of comments:
>
>>Assuming a null modem termination is correct (and I am sure it is)
>
>If it is correct, you should be able to short pins 2 and 3 together and
when
{Quote hidden}

you
{Quote hidden}


'RS232'
1999\02\02@225732 by Donald L Burdette
picon face
I suspect your ISA add-in serial card does not have the interrupt enabled
for that port.  If it's an old-fashioned type there's a jumper to select
which IRQ you want.  It sounds like you want the same IRQ your mouse is
on.  In most situations, this means moving the mouse IRQ as Imre
suggested, since things rarely work with two ports on the same IRQ
(although Bill Gates will tell you it should work).

                               Don


'RS232'
1999\03\31@004607 by Ciszkowski Willi
flavicon
face
I want a very simple RS232 communication software for 16C84.

Thanks

Please mail me to:
KILLspamwillispamBeGonespamcadtieccp.pub.ro

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