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.crotazTakeThisOuTic.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 }
> 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.
>From: Charles Manning <.....manningcKILLspam@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.crotazKILLspamIC.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: .....oadebcKILLspam.....robots.gsfc.nasa.gov | Statistics, Demos and Other Lies |
+---------------------------------------+-----------------------------------+
>
> >From: Charles Manning <EraseMEmanningcspam_OUTTakeThisOuTNZ.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.
>
> I went ahead and implemented my RS232 to match the above discription,
> and the routines now work just fine.
>
> >From: Bryan Crotaz <b.crotazspam_OUTIC.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.
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.
> 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:
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.
> KILLspampetitjKILLspamesiee-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.
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.
;
;
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.
> spamBeGonepetitjspamBeGoneesiee-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.
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.
;
;
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.
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: RemoveMEnogueiraTakeThisOuTmandic.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.
========================================================
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.
#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
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
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.
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
> 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.
>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:
>
>> 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.
>
>
Go on the drive of your life, this week in the book room:
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!!!
> >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:
> >
> >> 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)
> 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.
> 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!!!
>
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.
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":
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.
>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.
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":
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 ....
>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 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,
>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
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).