rs 232 error

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
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

Post by nuwan5213 »

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?
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

Post by medelec35 »

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
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

Post by Mikat »

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

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

Post by medelec35 »

Found this on:

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				        3000
So I have probably misread the length somewhere.

Martin.
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

Post by nuwan5213 »

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
Electronics for better world.

User avatar
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

Post by Benj »

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?

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

Post by nuwan5213 »

Ididnt get you ben?
Electronics for better world.

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

Post by nuwan5213 »

Can you please check my flow chart?
regards,
nuwan.
Electronics for better world.

User avatar
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

Post by Benj »

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.

User avatar
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

Post by Benj »

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.

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

Post by nuwan5213 »

Hi ben,
1herts flasher is runing perfectly.
regards,
nuwanHi ben,
1herts flasher is runing perfectly.
regards,
nuwan
Electronics for better world.

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

Post by nuwan5213 »

Yes.i tryed uart1 also.
but no results.
regards,
nuwan.Yes.i tryed uart1 also.
but no results.
regards,
nuwan.
Electronics for better world.

User avatar
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

Post by Benj »

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.

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

Post by nuwan5213 »

Not eblock.
my own hw.
i have fluke 187multimeter.
regards ,
nuwan.
Electronics for better world.

User avatar
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

Post by Benj »

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.

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

Post by nuwan5213 »

hi ben.
please check my cct.
Attachments
rs232.JPG
(183.52 KiB) Downloaded 1175 times
Electronics for better world.

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

Post by nuwan5213 »

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. :idea:
Electronics for better world.

Post Reply