Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 16th October 2007, 02:16 AM   #16
Default

Quote:
Originally Posted by Pommie
You must be using a software UART that sends and receives inverted signals. I am guessing that the reason it only works from PC to 8051 is because the 8051s outputs cannot drive the line high enough to provide a signal to the PC. Have you got a fairly low pullup on the output of your 8051? I would guess something like 300Ω would be safe.

Mike.
You got it the other way round, I can send 'A's from my 8051 uC to the laptop, but not from the laptop to the 8051 uC (unless something is wrong with my code for the latter).

My curiosity was of the fact that I did not need a Maxim chip in order to send from 8051 uC to the laptop, yet seem to require it to send from laptop to 8051 uC.

thanks for your help.
AceOfHearts is offline  
Old 16th October 2007, 03:35 AM   #17
Default

Quote:
Originally Posted by Pommie
This is slightly wrong and could confuse people. In Hyperterminal the number of start bits is always one and the number of stop bits is at least one. Sending out character slowly effectively inserts more stop bits. In RS232 terms there is no such thing as a packet everything is just a byte (sometimes 9 bits). You as a programmer may choose to packetise your data but the hardware just sends bytes. Settings in things like MSComm control are PC specific and nothing to do with the RS232 protocol.
Mike.
Look who is causing the confusion.
Wrong! - "Sending out characters slowly does not effectively insert more stop bits." This only increases the intercharacter delay.

The World According to Pommie


Yes, data being sent and received is transmitted in packets. Chunks is a better description but an inelegant choice of words which may be misunderstood as a result of a failure to handle excess and other words, run on long winded superfluous sentences, and phrases helping not the original questions but intending to yet again show off one attempts to upstage others as a remedy for patching the lack of real world importances in ones existence.

The stream is not perfect and the packets pushed are not logically separated by inserted characters but by time. These packets usually originate from the device side because devices, even though stream their data, do not send the entire buffer inside of one push as a artifact of internal delays and processing time. Even PCs do not push out data in a perfect stream. If you fill a buffer with even a small 50 bytes, the time space between those bytes will not be equal which can be easily seen with a software port monitor residing between two PC's or a physical monitor between a device and a PC. And due this unsymmetrical time space, operating systems perceive the stream in packets. This is why intercharacter delays exist, so to serve as an indicator of when all the data has arrived. This is also why the value of data size are included in the front of the data stream. If an application uses a DataReceived Event and pulls the data, there is no guaranty that what was pulled is the complete stream. For long data, it may just be the beginning of the stream. Hence the use of data size concatenation in front of stream, and properties like intercharacter delay InbufferCount, and OutbufferCount.
donniedj is offline  
Old 16th October 2007, 03:55 AM   #18
Default

Quote:
Originally Posted by donniedj
Look who is causing the confusion.
Wrong! - "Sending out characters slowly does not effectively insert more stop bits." This only increases the intercharacter delay.

The World According to Pommie


Yes, data being sent and received is transmitted in packets. Chunks is a better description but an inelegant choice of words which may be misunderstood as a result of a failure to handle excess and other words, run on long winded superfluous sentences, and phrases helping not the original questions but intending to yet again show off one attempts to upstage others as a remedy for patching the lack of real world importances in ones existence.

The stream is not perfect and the packets pushed are not logically separated by inserted characters but by time. These packets usually originate from the device side because devices, even though stream their data, do not send the entire buffer inside of one push as a artifact of internal delays and processing time. Even PCs do not push out data in a perfect stream. If you fill a buffer with even a small 50 bytes, the time space between those bytes will not be equal which can be easily seen with a software port monitor residing between two PC's or a physical monitor between a device and a PC. And due this unsymmetrical time space, operating systems perceive the stream in packets. This is why intercharacter delays exist, so to serve as an indicator of when all the data has arrived. This is also why the value of data size are included in the front of the data stream. This is just sooo wrong. If an application uses a DataReceived Event and pulls the data, there is no guaranty that what was pulled is the complete stream. For long data, it may just be the beginning of the stream. Hence the use of data size concatenation in front of stream, and properties like intercharacter delay InbufferCount, and OutbufferCount.
Check the specification for RS232, quote "The start bit has always space value, the stop bit always mark value." There is absolutely no difference between having an intercharacter delay and sending more stop bits.

You are once again confusing PC operation and the RS232 specification. Even MSComm control does not packetise data.

Mike.
Pommie is online now  
Old 16th October 2007, 04:42 AM   #19
Default

Quote:
Originally Posted by Pommie
Check the specification for RS232, quote "The start bit has always space value, the stop bit always mark value." There is absolutely no difference between having an intercharacter delay and sending more stop bits.

You are once again confusing PC operation and the RS232 specification. Even MSComm control does not packetise data.

Mike.
Again you are correct.

RS232 is just a hardware serial interface standard. How many characters, how few, how lumped or chunked or packetized is strickly a function of the application software and has no relationship or is even specified in the orginal RS-232C standard. It was designed as a character based digital communications standard, with no predefined minimum or maxium block size.

This standard was first used with ASCII Teletype machines in the 60s where people would type at the keyboard and send the characters one at a time to the recieving teletype at whatever speed the operator could handle up to the limit of the machine, usually around 100 words per mins (yes mins!) One could also send via a pre-punched paper tape message that someone typed ahead of time. Later video terminals started to utilize the standard to hook to modems for communicating with central time sharing computers.

The RS-232 standard predates the introduction of microcomputer or PC computers and was used for many forms of early digital communications used by the telecommunications companies and well as the military.

I don't even think the 'standard baud rates' (...2400,4800,9600,etc) used is defined in the standard and one is still within the standard to send at a 1,111 baud rate and not violate the standard. Of course the recieving end has to be configured to expect this odd ball baud rate.



Lefty
__________________
Measurement changes behavior
Leftyretro is offline  
Old 16th October 2007, 09:06 PM   #20
Default

When I type something into Hyperterminal, it should come up on the screen and be transmitted right?

But how come nothing happens when I press a key (I am checking using an oscilloscope the serial port output). Nothing comes up on the screen, nor is anything transmitted through the port??
AceOfHearts is offline  
Old 16th October 2007, 09:25 PM   #21
Default

Quote:
Originally Posted by AceOfHearts
When I type something into Hyperterminal, it should come up on the screen and be transmitted right?
No, it shouldn't be displayed on the screen, only if it's echoed back by the other end - this is normal, and proves it's all working if the character appears on screen.

Quote:

But how come nothing happens when I press a key (I am checking using an oscilloscope the serial port output). Nothing comes up on the screen, nor is anything transmitted through the port??
Do you have handshaking set to NONE.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 16th October 2007, 09:58 PM   #22
Default

Quote:
Originally Posted by AceOfHearts
When I type something into Hyperterminal, it should come up on the screen and be transmitted right?

But how come nothing happens when I press a key (I am checking using an oscilloscope the serial port output). Nothing comes up on the screen, nor is anything transmitted through the port??
That depends if your properties are set for full or half duplex operation. Attached is the properites panel where you can have hyperterminal do a 'local echo' (half duplex mode) of the characters typed from the keyboard (click on the echo option). In full duplex mode (no local echo selected) you have to rely of the receiving end echoing back characters that you type and that is a function of the software on the receiving device, to echo back the chararcter or not.

As far as nothing being sent when you type, check for none as a handshacking option as already suggested.

Also you have to make sure the baud rate and bits/stop bits configuration values are the same for both the sending (hyperterminal) and the receiving device.

PS: Again there are much better PC serial communications software applications avalible both free and for sale. Many are much easier to configure and provide more information on screen as to settings and modes and status. Some will allow displaying the data in binary, hex as well as ASCII form.
Lefty
Attached Thumbnails
New to serial communication, Hyperterminal?-hyper.jpg  
__________________
Measurement changes behavior

Last edited by Leftyretro; 16th October 2007 at 10:05 PM.
Leftyretro is offline  
Old 19th October 2007, 02:29 AM   #23
Default

Quote:
Originally Posted by Leftyretro
PS: Again there are much better PC serial communications software applications avalible both free and for sale. Many are much easier to configure and provide more information on screen as to settings and modes and status. Some will allow displaying the data in binary, hex as well as ASCII form.
Lefty
That sounds great! Can you please suggest me any softwares (with links) that can do this?

Many thanks.

PS. Thanks to everyone for all the help. I have now managed to interface an LCD display where typed letters directly appear on the LCD.
AceOfHearts is offline  
Old 19th October 2007, 05:33 AM   #24
Default

Quote:
Originally Posted by AceOfHearts
That sounds great! Can you please suggest me any softwares (with links) that can do this?

Many thanks.

PS. Thanks to everyone for all the help. I have now managed to interface an LCD display where typed letters directly appear on the LCD.
My current favorite is Bray terminal, it's freeware and powerful. Sending macros, etc. I've attached the zip file

Lefty
Attached Files
File Type: zip terminal_v1-9b.zip (217.4 KB, 22 views)
__________________
Measurement changes behavior
Leftyretro is offline  
Old 19th October 2007, 07:09 PM   #25
Default

Quote:
Originally Posted by Leftyretro
My current favorite is Bray terminal, it's freeware and powerful. Sending macros, etc. I've attached the zip file

Lefty
Excellent software. Many thanks
AceOfHearts is offline  
Old 8th December 2007, 09:07 AM   #26
Default

hi i hv got a ques. for pommie:

so finally, do we need a max232 ic or not?
sheelvant singh is offline  
Old 8th December 2007, 09:19 AM   #27
Default

For correct operation you should use a Max232. However, bitbanged RS232 can invert the signal in software and most (I haven't found one that doesn't) PCs will be able to use this signal. Some newer pics have the ability to invert the signal in hardware.

You can also use a transistor to invert the signal. See this thread.

Mike.
Pommie is online now  
Reply

Tags
communication, hyperterminal, serial

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
serial communication in Atmel 89c51 Peter Nabil Micro Controllers 9 4th August 2008 01:18 PM
hyperterminal communication w/ 8051 spyghost 8051/8951 8 22nd May 2008 11:54 AM
Need help badly on Inchworm and MPLAB thushy Micro Controllers 14 11th March 2007 07:05 PM
serial communication between two pic with RF modules amindzo Micro Controllers 8 16th August 2006 04:59 PM
Serial communication problem tbrown Micro Controllers 12 13th February 2004 11:32 AM



All times are GMT. The time now is 03:08 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker