rs 232 error
Moderator: Benj
-
nuwan5213
- Posts: 82
- Joined: Thu Jul 29, 2010 10:03 am
- Location: sri lanka
- Has thanked: 24 times
- Been thanked: 4 times
rs 232 error
hi.
im going to get keypad number and unit id to pc via rs 232 com port
i use 9600 and 19200 also but i can recive [~~~~~~~ü€ø þ þ€àüàþà€ þü þàþð€ þ À ü þþ €ü]
like that.
im sending strings
simiulation mod is ok and it displays what i typed with key pad.
whats the problem with it?
im using 16mhz xtal and is it ok? propertis window of that will attached.
computer setting are ok ,com 1 properties changed to 19200.
please help.
should i have to change the xtal?
im going to get keypad number and unit id to pc via rs 232 com port
i use 9600 and 19200 also but i can recive [~~~~~~~ü€ø þ þ€àüàþà€ þü þàþð€ þ À ü þþ €ü]
like that.
im sending strings
simiulation mod is ok and it displays what i typed with key pad.
whats the problem with it?
im using 16mhz xtal and is it ok? propertis window of that will attached.
computer setting are ok ,com 1 properties changed to 19200.
please help.
should i have to change the xtal?
- Attachments
-
- data_device_mod.fcf
- (14 KiB) Downloaded 304 times
-
- prog.JPG
- (155.96 KiB) Downloaded 1206 times
Electronics for better world.
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: rs 232 error
Personally I have found that if using software rather that hardware (using built in TX pin in case of 16F877 is pin 25 = RC6), you are much more limited to the maximum speed.
What about reducing baud to 4800? Then if works, increase to 9600 etc.
Also the length of RS232 lead can have an effect if too long. Personally with good quality cable , I would not go more than 2 metres in length, and I think that would be pushing it.
Other people may have different opinions of course.
Martin
What about reducing baud to 4800? Then if works, increase to 9600 etc.
Also the length of RS232 lead can have an effect if too long. Personally with good quality cable , I would not go more than 2 metres in length, and I think that would be pushing it.
Other people may have different opinions of course.
Martin
Martin
-
Mikat
- Posts: 258
- Joined: Wed Nov 29, 2006 6:32 pm
- Location: Finland
- Has thanked: 7 times
- Been thanked: 36 times
Re: rs 232 error
Hi.
What comes to the cable,at my boat I use over 5m total lenght cable to data link for self made Eberspäher ecu and the heater fan controller, and it has at least 3 connections on the way, cable is normal Samtec multi wire and baudrate is 9600, no problems..
But the data is just about 15 bytes at once a second and the uart is run by hardware...
Mika
What comes to the cable,at my boat I use over 5m total lenght cable to data link for self made Eberspäher ecu and the heater fan controller, and it has at least 3 connections on the way, cable is normal Samtec multi wire and baudrate is 9600, no problems..
But the data is just about 15 bytes at once a second and the uart is run by hardware...
Mika
-
medelec35
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: rs 232 error
Found this on:
http://www.lammertbies.nl/comm/info/RS-232_specs.html
So I have probably misread the length somewhere.
Martin.
http://www.lammertbies.nl/comm/info/RS-232_specs.html
Code: Select all
Baud rate Maximum cable length (ft)
19200 50
9600 500
4800 1000
2400 3000Martin.
Martin
-
nuwan5213
- Posts: 82
- Joined: Thu Jul 29, 2010 10:03 am
- Location: sri lanka
- Has thanked: 24 times
- Been thanked: 4 times
Re: rs 232 error
No change redusing to bud4800.
is it softwear bug.
please help.
regards
nuwanNo change redusing to bud4800.
is it softwear bug.
please help.
regards
nuwan
is it softwear bug.
please help.
regards
nuwanNo change redusing to bud4800.
is it softwear bug.
please help.
regards
nuwan
Electronics for better world.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: rs 232 error
Hello Nuwan,
Have you tried using the Hardware UART in Flowcode rather then the software UART. The software UART is nowhere near as reliable as the hardware UART so this is a good starting point. Have you performed a 1 second flasher test to ensure your clock speed and configuration settings correctly match your hardware?
Have you tried using the Hardware UART in Flowcode rather then the software UART. The software UART is nowhere near as reliable as the hardware UART so this is a good starting point. Have you performed a 1 second flasher test to ensure your clock speed and configuration settings correctly match your hardware?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: rs 232 error
Hello,
Create a while 1 loop which switched on a output pin, delays for a second, switches off the output pin and finally delay for a second.
Send this program to the hardware and connect a LED to your output pin.
If the LED flashes at the right rate eg 0.5Hz then you know you have your clock speed and configuration settings correct for your hardware.
This also means things like the RS232 baud rate is being calculated correctly for your hardware.
Create a while 1 loop which switched on a output pin, delays for a second, switches off the output pin and finally delay for a second.
Send this program to the hardware and connect a LED to your output pin.
If the LED flashes at the right rate eg 0.5Hz then you know you have your clock speed and configuration settings correct for your hardware.
This also means things like the RS232 baud rate is being calculated correctly for your hardware.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: rs 232 error
Your program looks ok to me as you have configuration settings and a non standard clock speed.
Have you tried using the UART in hardware mode rather then software mode. Right click the RS232 component, select ext properties and then set the TX/RX to UART1.
Have you tried using the UART in hardware mode rather then software mode. Right click the RS232 component, select ext properties and then set the TX/RX to UART1.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: rs 232 error
Hello Nuwan,
OK what do you have connected to your PortC. Are you using a RS232 E-block or are you using your own hardware.
If your using the E-block then are the jumper settings correct, option C should work for the 16F877.
Do you have a scope or anything similar you can use to check if the UART pins are waggling correctly.
OK what do you have connected to your PortC. Are you using a RS232 E-block or are you using your own hardware.
If your using the E-block then are the jumper settings correct, option C should work for the 16F877.
Do you have a scope or anything similar you can use to check if the UART pins are waggling correctly.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: rs 232 error
Hello,
Do you have a schematic for the hardware so we can have a look and make sure this is all ok.
Have you used your multimeter to confirm that everything is connected up correctly. You may even be able to use the PWM mark space monitoring on your meter to see if the TX pin is toggling correctly.
Do you have a schematic for the hardware so we can have a look and make sure this is all ok.
Have you used your multimeter to confirm that everything is connected up correctly. You may even be able to use the PWM mark space monitoring on your meter to see if the TX pin is toggling correctly.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
nuwan5213
- Posts: 82
- Joined: Thu Jul 29, 2010 10:03 am
- Location: sri lanka
- Has thanked: 24 times
- Been thanked: 4 times
Re: rs 232 error
Hi again,
benj,medelec,
problem solved.i just changed max232 ic.it works nicely.
thank you for your quick responses.
regards,
nuwan.Hi again,
benj,medelec,
problem solved.i just changed max232 ic.it works nicely.
thank you for your quick responses.
regards,
nuwan.
benj,medelec,
problem solved.i just changed max232 ic.it works nicely.
thank you for your quick responses.
regards,
nuwan.Hi again,
benj,medelec,
problem solved.i just changed max232 ic.it works nicely.
thank you for your quick responses.
regards,
nuwan.
Electronics for better world.