I dont think the PC is special (Its just a regualar pocket PC, and it communicates fine with a standard PC). But im beginning to think there may be something with the Cradle for it wich im using.
The cradle (wich is a original Compaq) does have two connection choises, one USB and one COM (DB9)
Maybe i should tear the cradle up, to see so there isnt some stupid circuits in there. (Doubtfull though) but this is no good.
Thank you for all your help btw! Hope we can solve this!
1:30 is still early for hoobies, but not good for the day after, read you loud and clear
When I first started using the propeller I found I could program it with the PC, but I could not get reasonable transmissions through the serial port. I was using the two transistor circuit. The characters were all messed up.
Later, I found that I was using the internal clock RCFAST, and that was not accurate enough for serial transmission. I put in a 5mhz crystal and the serial communication worked perfectly.
I then did some experiments with RCFAST and found if I was transmitting and receiving with the propeller to the PC at 1200 baud, I could set the propeller to 1100 baud and it would work. I had to play with the numbers to find the correct one. But, that was just an experiment for me to better understand what was happening. I use a crystal to avoid that.
When I first started using the propeller I found I could program it with the PC, but I could not get reasonable transmissions through the serial port. I was using the two transistor circuit. The characters were all messed up.
Later, I found that I was using the internal clock RCFAST, and that was not accurate enough for serial transmission. I put in a 5mhz crystal and the serial communication worked perfectly.
I then did some experiments with RCFAST and found if I was transmitting and receiving with the propeller to the PC at 1200 baud, I could set the propeller to 1100 baud and it would work. I had to play with the numbers to find the correct one. But, that was just an experiment for me to better understand what was happening. I use a crystal to avoid that.
Rocky! Thats great info.
But im hooking this project upp with my Demoboard, and using the external crystal at PLL16.
I hate to ask you this, but looking at the DB9 I am wondering which pins you are measuring. Is it really 2 and 3? If you had measured 3 & 4 then you would see both at a negative voltage with the port closed. You can always find the DTR as that signal will go positive when you open the port such as when you connect with putty. The TXD signal can also be verified too as the voltage reading will become less "negative" as you type characters. Especially will this be more noticeable at lower baud rates.
Having ascertained the DTR and TXD (just in case) then a loopback between TXD and RXD will verify that you have RXD. Check the other pins if there appears to be any kind of confusion or discrepancy. Don't worry about shorting pins as it is not possible to damage the RS232 port this way. BTW, the DB9 should be a male connector as the female connector is pinned differently (or should be).
I hate to ask you this, but looking at the DB9 I am wondering which pins you are measuring. Is it really 2 and 3? If you had measured 3 & 4 then you would see both at a negative voltage with the port closed. You can always find the DTR as that signal will go positive when you open the port such as when you connect with putty. The TXD signal can also be verified too as the voltage reading will become less "negative" as you type characters. Especially will this be more noticeable at lower baud rates.
Having ascertained the DTR and TXD (just in case) then a loopback between TXD and RXD will verify that you have RXD. Check the other pins if there appears to be any kind of confusion or discrepancy. Don't worry about shorting pins as it is not possible to damage the RS232 port this way. BTW, the DB9 should be a male connector as the female connector is pinned differently (or should be).
Hello! Slept well? ;P
We may be on to something here, (cant measure right now)
But the cable in this case is ofcourse a female, since its made to connect to a PC wich always have male connectors.
What is different in the pins here, besides that the RX TX pins may be thrown ?
Ok, this is where you come to understand about providing as much information as possible right up front, sometimes a picture spares a long thread. The pinout diagram you provided is of course for a PC with it's male connector. You must read your cable as mating with this one so you are looking at your db9 means that pin 5 is on the flip side etc. Meter these to make sure that 1 & 2 are zero volts and 3 & 4 are sitting at a negative voltage.
I have never managed to communicate reliably with a propeller any faster than 38400 baud. I think it might be because I have a 3 metre extension lead on the serial line. Back in the olden days when I had a computer with a serial monitor, 19200 was the fastest with a 5 metre cable.
Sometimes I've dropped the baud rate back to 1200 for debugging. Once I dropped it back to 110 baud (you can almost read the characters at that rate!).
If the propeller is being programmed then the hardware must be right.
Oh, another thing you probably have found by now - if you program a propeller and then you want to talk to it with a serial port, you have to close down the prop tool. Only one program can talk to a serial port at any one time. (which is why the prop tools terminal program can be handy as it is part of the prop tool program).
Another thing that helps a lot is a serial port sniffer program. http://smarthome.viviti.com/propeller and scroll down about 2/3 of the page to the "Useful Programs" section. I use this program all the time.
BTW most D9 plugs and sockets have the pin numbers on the plastic in very tiny writing - at the very least they usually have pin 1 and 5 marked.
I have been communicating reliably with the Prop at over 2M baud at logic and RS422 levels and even RS232 I can easily push over 460K baud (even double that). But being a pocket PC it may be underpowered somewhat and especially if the putty software is poorly written in that it may miss events when under load. Drop the connection to the slowest possible to verify connections and functionality.
It may seem that i have had a faulty schematics, i think the diagram i have had is for MALE!!! eventhough it was stated for female, OMG i really hope its that simple
well i have now tested to connect RXTX and it copies everything i write just fine So the ipaq does its job. There have to be something with the prop that aint working!
Edit:
Now for it to even spit out garbage i have to disconnect the props RX cable, or else nothing shows up. That also adds to the strangeness.
Are you still using the 2 transistor version of the 3 transistor RS232 programming interface? If so, remember that you have to have the other end of the 10K resistor attached to the Rx line connected to the DTR line. This provides a source of -5V for transmission back to the PC. You don't have to use DTR, but you need to use some signal line from the PC that's normally at -5V.
Are you still using the 2 transistor version of the 3 transistor RS232 programming interface? If so, remember that you have to have the other end of the 10K resistor attached to the Rx line connected to the DTR line. This provides a source of -5V for transmission back to the PC. You don't have to use DTR, but you need to use some signal line from the PC that's normally at -5V.
I dont have that circuit anymore..Could it still be a voltage problem this?
I would buy a max232 (since i didnt get this to work this weekend anyways) but i dont like that it dont work without it since it seems to work for everybody else.
It would be more comforting to know that the iPaq needs 5v and dont work on the props 3.3v, But i feel that i am missing something else, like to go to the bottom of that first, if you get me.
If you're measuring -5V on any of the IPAQ pins, then you need some kind of RS232 interface. RS232 uses voltages between -15V to -5V and 5V to 15V. The area between -5V and +5V is undefined and the IPAQ won't respond to it. Some PDAs and laptops take these boundaries to -3V to +3V, but not all.
With a Prop, you should use a MAX3232 rather than a MAX232. The former is designed for use at 3.3V. Sometimes the MAX232 will work at that voltage, but it's not designed for that.
If you read the datasheet for the MAX232, it really is designed for use at 5V. Although people have used it with a 3.3V supply and reported that it functions, that doesn't mean that it's reliable at that supply voltage. If you have too much noise or the supply voltage is a little bit off or ... it may not always work. Since that's what you've bought, try it. If it works, great. If it doesn't work, don't be surprised. Go get the proper part for your supply voltage.
I'm not sure if this is the problem or not... but your sample code takes a while to send "Hello World". Anyway, I modified your code a little; added a loop and sent the output to my PC's serial port through the FTDI (USB). Also I used FullDuplexSerial since I did not have FullDuplexSerialPlus handy.
First, make sure your code is functioning as expected. Verify by firing up the Parallax Serial Terminal on your PC. If everything is a go, wire up your PPC and update the code to output on the appropriate pins.
Max232 will work but you will need 1k protection resistors between the max232 and the propeller. And a 5V supply.
I find that there are so many things on a board that need a 5V supply anyway (eg keyboard, mouse, amplifier) that is is no problem having a 5V and 3V supply. And the max232 seems cheaper and easier to get than a max3232. But at the end of the day it does not really matter.
Re confusion on the male and female pins, just wire up 3 wires. Pin 5 is always ground. Data comes out of pin 3 on a male, so if you plugged a female plug into that male, and data comes out of pin 3 on a male, then data must go into pin 3 on a female. Ditto data comes out of pin 2 on a female, and into pin 2 on a male.
Just ignore all the other pins for the moment.
Oh, and drop the baud rate to 1200 for the moment. You can always increase it later.
Comments
Both 2 & 3 show the same (-6V) when measured?
I have to clock off now, it's 1:30 in the morning (still early) but I need some zeds.
The cradle (wich is a original Compaq) does have two connection choises, one USB and one COM (DB9)
Maybe i should tear the cradle up, to see so there isnt some stupid circuits in there. (Doubtfull though) but this is no good.
Thank you for all your help btw! Hope we can solve this!
1:30 is still early for hoobies, but not good for the day after, read you loud and clear
Later, I found that I was using the internal clock RCFAST, and that was not accurate enough for serial transmission. I put in a 5mhz crystal and the serial communication worked perfectly.
I then did some experiments with RCFAST and found if I was transmitting and receiving with the propeller to the PC at 1200 baud, I could set the propeller to 1100 baud and it would work. I had to play with the numbers to find the correct one. But, that was just an experiment for me to better understand what was happening. I use a crystal to avoid that.
Rocky! Thats great info.
But im hooking this project upp with my Demoboard, and using the external crystal at PLL16.
But your info is great for future reference!
Having ascertained the DTR and TXD (just in case) then a loopback between TXD and RXD will verify that you have RXD. Check the other pins if there appears to be any kind of confusion or discrepancy. Don't worry about shorting pins as it is not possible to damage the RS232 port this way. BTW, the DB9 should be a male connector as the female connector is pinned differently (or should be).
Hello! Slept well? ;P
We may be on to something here, (cant measure right now)
But the cable in this case is ofcourse a female, since its made to connect to a PC wich always have male connectors.
What is different in the pins here, besides that the RX TX pins may be thrown ?
COM1
Baud: 115200
Parity: None
Flow Control: None
Data Bits: 8
Stop Bits: 1
I have never managed to communicate reliably with a propeller any faster than 38400 baud. I think it might be because I have a 3 metre extension lead on the serial line. Back in the olden days when I had a computer with a serial monitor, 19200 was the fastest with a 5 metre cable.
Sometimes I've dropped the baud rate back to 1200 for debugging. Once I dropped it back to 110 baud (you can almost read the characters at that rate!).
If the propeller is being programmed then the hardware must be right.
Oh, another thing you probably have found by now - if you program a propeller and then you want to talk to it with a serial port, you have to close down the prop tool. Only one program can talk to a serial port at any one time. (which is why the prop tools terminal program can be handy as it is part of the prop tool program).
Another thing that helps a lot is a serial port sniffer program. http://smarthome.viviti.com/propeller and scroll down about 2/3 of the page to the "Useful Programs" section. I use this program all the time.
BTW most D9 plugs and sockets have the pin numbers on the plastic in very tiny writing - at the very least they usually have pin 1 and 5 marked.
It may seem that i have had a faulty schematics, i think the diagram i have had is for MALE!!! eventhough it was stated for female, OMG i really hope its that simple
Is this the correct pin conf for a DB9 female?
http://www.circuitdb.com/downloadimg.php?fileID=136
Edit:
Now for it to even spit out garbage i have to disconnect the props RX cable, or else nothing shows up. That also adds to the strangeness.
Did you want RX and TX to be inverted? Make sure that's what you want.
And how come it works when i loop it?
Well that is still a Male db9? And for what i understand a female is pinned different?
Yes BUT it is only signal pins that are swapped
GND is always on same pin
This is so strange, since the ipaq does its job when i cross the RX TX it loops just great.
I dont have that circuit anymore..Could it still be a voltage problem this?
I would buy a max232 (since i didnt get this to work this weekend anyways) but i dont like that it dont work without it since it seems to work for everybody else.
It would be more comforting to know that the iPaq needs 5v and dont work on the props 3.3v, But i feel that i am missing something else, like to go to the bottom of that first, if you get me.
With a Prop, you should use a MAX3232 rather than a MAX232. The former is designed for use at 3.3V. Sometimes the MAX232 will work at that voltage, but it's not designed for that.
But looking at the datasheet, 3.3v doesnt seem to be a problem?
Input threshold is min 2v?
First, make sure your code is functioning as expected. Verify by firing up the Parallax Serial Terminal on your PC. If everything is a go, wire up your PPC and update the code to output on the appropriate pins.
I find that there are so many things on a board that need a 5V supply anyway (eg keyboard, mouse, amplifier) that is is no problem having a 5V and 3V supply. And the max232 seems cheaper and easier to get than a max3232. But at the end of the day it does not really matter.
Re confusion on the male and female pins, just wire up 3 wires. Pin 5 is always ground. Data comes out of pin 3 on a male, so if you plugged a female plug into that male, and data comes out of pin 3 on a male, then data must go into pin 3 on a female. Ditto data comes out of pin 2 on a female, and into pin 2 on a male.
Just ignore all the other pins for the moment.
Oh, and drop the baud rate to 1200 for the moment. You can always increase it later.