I looked at it some more and I think I see your problem!
You shouldn't be using the SERIN_DEC function from BS2_functions because that expects ASCII text ending in a <CR> character...
But, your device is just sending 3 bytes of raw data (I think).
So, just replace SERIN_DEC with SERIN_CHAR.
The TV.dec function you already have with then display this byte as a number...
I got help from Parallax touse the scope and I think I got the answer you were seeking.
Ihave attached the scope picture of the serial out-put from the serial device.I scoped all the 9 pins coming out of the serial device - what is attached is the out-put from Pin 2.Your hunch was afterall right- I still wonder why when the pin 3 is connected to BS2 and it works.
As you can see the output Voltages are high and my guess is I will require the transistor circuit - like you advised with only the left transistor to feed the input to the PropRpm.I am planning to use different pin as I have some to spare and keep the built -in serial connection to connect to the PC.
Please advise if my descion is -OK if not direct me in the right direction.
If the PC(DTE) can talk to your device(DCE) and the PC(DTE) can talk to the PropRPM(DCE)· but the PropRPM(DCE) cannot talk to the device(DCE) then I would think you need what is called a null modem cable. Sounds like you have a 'straight trough' cable (pin 2 to pin 2 and pin 3 to pin 3) . A null modem cable would have pin2 going to pin3 and vice versa.
·You are absolutely right - I made a new cable switching the pins ·2 & 3 and now I am receiving data - but the new problem is they are not same decimal numbers they are suppose to be.
I tried inverting the signal - still I get data but they are not right.
If you can receive the data correctly with the software provided for the device and by the rs232 analyzing software but NOT by hyperterminal correctly then I would guess that the way the data is presented to hyperterminal is the way your program is trying to read it also. Have a look at what is actually being received by the analyzing software.
One other thing to look at is if the signal is inverted or not. You could just try both inverted and non-inverted modes in the SERIN_CHAR function's mode parameters. You can also tell this by using your scope on PIN31 to see what the signal looks like.
Also, once you get the signal on Pin31 of the Prop (like you showed above), you can actually read the data right off the scope screen...
Rayman/Pete,
I have finally able to display the correct data on the screen.
The final solution was swapping the pins 2&3, inverting the signal and routing the signal via the DB9 - port in the PropRPM.
Although I can get the signal via the transisitor circuit to the PropRPM but was not able to get the correct data display.
Now that I have accomplished what I was after now I can proceed to the next step in my project.
I am very thankful to both of you for your extrodinary ability to stick with me to and to guide me along to resolve the issue.
I learned a lot about serial communication and as an additional bonus learned fast lesson on how to use a scope to read a serial signal.
Comments
I looked at it some more and I think I see your problem!
You shouldn't be using the SERIN_DEC function from BS2_functions because that expects ASCII text ending in a <CR> character...
But, your device is just sending 3 bytes of raw data (I think).
So, just replace SERIN_DEC with SERIN_CHAR.
The TV.dec function you already have with then display this byte as a number...
I got help from Parallax touse the scope and I think I got the answer you were seeking.
Ihave attached the scope picture of the serial out-put from the serial device.I scoped all the 9 pins coming out of the serial device - what is attached is the out-put from Pin 2.Your hunch was afterall right- I still wonder why when the pin 3 is connected to BS2 and it works.
As you can see the output Voltages are high and my guess is I will require the transistor circuit - like you advised with only the left transistor to feed the input to the PropRpm.I am planning to use different pin as I have some to spare and keep the built -in serial connection to connect to the PC.
Please advise if my descion is -OK if not direct me in the right direction.
Thanks once again for all the help.
Siri
Read my last post! I think your real problem is with your code...
I will change the code as you suggested and will get back.
Thanks,
Siri
If the PC(DTE) can talk to your device(DCE) and the PC(DTE) can talk to the PropRPM(DCE)· but the PropRPM(DCE) cannot talk to the device(DCE) then I would think you need what is called a null modem cable. Sounds like you have a 'straight trough' cable (pin 2 to pin 2 and pin 3 to pin 3) . A null modem cable would have pin2 going to pin3 and vice versa.
·You are absolutely right - I made a new cable switching the pins ·2 & 3 and now I am receiving data - but the new problem is they are not same decimal numbers they are suppose to be.
I tried inverting the signal - still I get data but they are not right.
What is this new problem - ? code.
Thanks,
Siri
If you can receive the data correctly with the software provided for the device and by the rs232 analyzing software but NOT by hyperterminal correctly then I would guess that the way the data is presented to hyperterminal is the way your program is trying to read it also. Have a look at what is actually being received by the analyzing software.
Pete
After I switched the P2&P3· and changed the code of the BS2 calls to "serin_char" as you suggested.
Now it shows incorrect decimal values.
I was using a trial version - "serial port analyser"- and the function I need is blocked.So when I get a
fully working software version,I will get back to you.
Thanks for the help.
Siri
Here is a link to that terminal program that I mentioned.It works very well at seeing what is happening on your rs232.
http://braypp.googlepages.com/terminal
Pete
Also, once you get the signal on Pin31 of the Prop (like you showed above), you can actually read the data right off the scope screen...
I tried inverting the signal - still not correct data,tried different parity - not successful.
The data coming out of the serial device· when connected toa serial devise analyser is: 96000 8N1 - the out put is "Decimal" - with the correect data.
I will try to read the Data off the scope ? this p.m and will get back to you.
Thanks for taking all this time to help me.
Siri
I have finally able to display the correct data on the screen.
The final solution was swapping the pins 2&3, inverting the signal and routing the signal via the DB9 - port in the PropRPM.
Although I can get the signal via the transisitor circuit to the PropRPM but was not able to get the correct data display.
Now that I have accomplished what I was after now I can proceed to the next step in my project.
I am very thankful to both of you for your extrodinary ability to stick with me to and to guide me along to resolve the issue.
I learned a lot about serial communication and as an additional bonus learned fast lesson on how to use a scope to read a serial signal.
Thank you
Siri