Well i am trying to control the PSC with the prop but i can not seem to get it to work could somone look at my code and see if i am doing some thing wrong.
Post Edited By Moderator (Chris Savage (Parallax)) : 5/10/2007 3:59:07 PM GMT
You didn't include the definition of "scsf1". Some obvious problems:
1) You're declaring the control strings as "long". This will put one character per long word (4 bytes) with the other bytes zero. You want to declare them as "byte".
2) UART.tx will transmit one byte. In your "main" routine, you'll transmit the value "scsf1" as a single byte, that's all.
3) You may want to use UART.str and pass it the address of a sequence of bytes. These byte strings HAVE to end with a zero byte. For example, you could have the declaration 'scbm1 byte "!SC",crs1,ra,mb,$0D,0' in your DAT section and then do "UART.str(@scbm1)" to send the string.
4) Why are you using a mode value of 2 in your start() call? I thought the PSC used normal (non-inverted) mode for both transmit and receive (I could be wrong!). That would result in a mode of zero.
Sorry about the lack of comments here is the code changed so that it has all the comments and I changed it to how you showed me, alas it still does not work with the BS2·or the prop·I can get the ver number with the·BS2·(it is 1.4) but I cannot control any servos.
The PSC is still not working for the prop but it now works for the BS2 my problem·was that I left the jumper on that determines what servos it controls I had it set for 16-32 but I was trying to control 0-15 'LOL!'
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
Are you using a series resistor on the I/O line? Due to the design of the PSC it may not function with a series resistor which would typically be required on the Propeller. This may cause an incompatibility with this particular product. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
In your "main" method, you call UART.str(), then WAITCNT, then you call UART.tx().
It looks like the 2nd call to the serial I/O should be UART.str().
How about either hooking up a serial LCD display or using a little tv with a video output or some other kind of debug display
so you can insert messages that say "I'm here and this worked" or "here's the value ..."?. It's not very useful to just say
something didn't work. What happened and when? Even a couple of LEDs are handy to show you what progress you've made
and when things happened or didn't happen.
Chris I do not have a scope. Mike reason than it is UART.str and then UART.TX is that i am trying them both with one download. So Chris·I might not be able to use the psc with the prop?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
I just feel you’re probably drawing too much current without the series resistor and with it you probably won’t get the levels you need. I’d have to do some tests to be sure but I have a seen a similar situation with another device.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
OK i have tried sending the data with the prop to hyperterminal and it seems to only be geting !SC what would cause this? and could this be my problem?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
·· I did some testing this morning and I can talk to it just fine. My concerns are that in order to get enough pull-down I had to use a 220 ohm resistor, much less than we recommend for connecting 5V devices to the Propeller. As with the GPS interface there are no fancy or elaborate schemes for the connection, just a simple in-line/series resistor. Using the attached code I get ‘1.4’ on my terminal screen when running this program. Again, the current is what I would be concerned about. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
· Not sure if this will help but this is the test code I messed with to get the old PWMPal to work with the Prop just for fun.· I used a 260 ohm resistor for testing.· I switched this over to a small fet in the end to keep it safe.
That’s probably the safer answer…Driving the device with a transistor but you will lose two-way communication unless you add a second for the other direction. Of course, you’ll also have to invert the signals. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
When you say the program works do you mean you’re getting the version? If so my guess is that you’re not sending the correct information for servo positioning…8 bytes need to be sent. Some are ASCII characters and others are binary values with the pulse width being a word value split into high/low bytes. Can you post the code you’re trying to use? That may give a clue as to what you’re doing wrong. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
· Like you said Chris,· you got a 220 working and the max I got to work was only a 260 ohm resistor.· Thats just not going to last too long.· · · Dumb question,· I did some messing around with run'n the prop on 5v just for fun back then as well.· It was only talking "no leds being powered from the prop" and thing seemed to run just fine.· · · What would be better· ·· · Powering the prop from 5v to drive a 5v line "this would be easier on the diodes right?"··· OR· · Powering the prop from 3.3v to drive a 5v line with less than a 300 ohm resistor?
Well, you cannot power the Propeller from 5V, so that removes option number one right there. Option number two is where we’re at with the issue of the pins being 5V tolerant to the extent of at extremely low current. To that end we recommend a 1K resistor be used on any 5V input into the Propeller. 220 (260) is just too low. It may survive and it may not. We cannot guarantee that it will though. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
Ok I can now control a servo with the PSC and the prop the code i am useing is atached. But one way works and one·way does not work.·The way that does not work is below.
If you have it handy, would you give me an idea of the best way to wire the PSC up? I have read through the 5V interface sticky and there are a lot of options there, but I don't have the background to evaluate which would be better/safer. I hope you will also be able to supply specific part numbers for the transistors (if they are needed).
I believe I was already working on such an interface and there was some issue causing problems. If I get a chance tomorrow I will test my theory and post a schematic. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
Just to bump this post, has there been any progress on this Chris?· I really appreciate the support.
I have some ideas, but they are based on some possibly incorrect assumptions on how this connection works.·
What I can gather is that the·"no data transfer" state of·the PSC is a steady +5V.· I'm not sure where the circuit grounds in this case. (high resitance ground in one or both chips?)· When one side wants to transfer data, it grounds the signal to a low resistance ground?
I'll share·what I have come up with if the above assumptions are correct.
The other option I have thought about is desoldering/cutting out the LED so I can use a 10K resister as with other 5V devices.
I just·got my Prop working so I'll try out some ideas and report back as soon as I get parts in.······
I haven’t had time lately to test it…without some sort of level transitioning interface though it’s not going to work. Using a resistor large enough isn’t going to allow it to go low enough to register a logic 0. I remember testing a transistor interface for the RS-232 interface thread in the Completed Projects Forum. That worked, but again, at 5V.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support
Comments
1) You're declaring the control strings as "long". This will put one character per long word (4 bytes) with the other bytes zero. You want to declare them as "byte".
2) UART.tx will transmit one byte. In your "main" routine, you'll transmit the value "scsf1" as a single byte, that's all.
3) You may want to use UART.str and pass it the address of a sequence of bytes. These byte strings HAVE to end with a zero byte. For example, you could have the declaration 'scbm1 byte "!SC",crs1,ra,mb,$0D,0' in your DAT section and then do "UART.str(@scbm1)" to send the string.
4) Why are you using a mode value of 2 in your start() call? I thought the PSC used normal (non-inverted) mode for both transmit and receive (I could be wrong!). That would result in a mode of zero.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My computer, http://forums.parallax.com/showthread.php?p=630466
Post Edited (boeboy) : 5/30/2007 7:11:30 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
Post Edited (boeboy) : 5/14/2007 8:05:25 PM GMT
:EDIT:forgot the code
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
Are you using a series resistor on the I/O line? Due to the design of the PSC it may not function with a series resistor which would typically be required on the Propeller. This may cause an incompatibility with this particular product. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
It looks like the 2nd call to the serial I/O should be UART.str().
How about either hooking up a serial LCD display or using a little tv with a video output or some other kind of debug display
so you can insert messages that say "I'm here and this worked" or "here's the value ..."?. It's not very useful to just say
something didn't work. What happened and when? Even a couple of LEDs are handy to show you what progress you've made
and when things happened or didn't happen.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
Post Edited (boeboy) : 5/17/2007 10:17:24 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lets see what this does... KA BOOM (note to self do not cross red and black)
Thankyou.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My computer, http://forums.parallax.com/showthread.php?p=630466
·· I did some testing this morning and I can talk to it just fine. My concerns are that in order to get enough pull-down I had to use a 220 ohm resistor, much less than we recommend for connecting 5V devices to the Propeller. As with the GPS interface there are no fancy or elaborate schemes for the connection, just a simple in-line/series resistor. Using the attached code I get ‘1.4’ on my terminal screen when running this program. Again, the current is what I would be concerned about. I hope this helps. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Post Edited (KC8DKT) : 5/30/2007 10:30:18 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My computer, http://forums.parallax.com/showthread.php?p=630466
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My computer, http://forums.parallax.com/showthread.php?p=630466
·
· Dumb question,· I did some messing around with run'n the prop on 5v just for fun back then as well.· It was only talking "no leds being powered from the prop" and thing seemed to run just fine.·
·
· What would be better·
··
· Powering the prop from 5v to drive a 5v line "this would be easier on the diodes right?"··· OR·
· Powering the prop from 3.3v to drive a 5v line with less than a 300 ohm resistor?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
with full being FullDuplexSerial
but when I try to use a string in a data block
·
and send it like this
It does not control the servo.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My computer, http://forums.parallax.com/showthread.php?p=630466
Post Edited (boeboy) : 5/31/2007 10:02:31 PM GMT
If you have it handy, would you give me an idea of the best way to wire the PSC up? I have read through the 5V interface sticky and there are a lot of options there, but I don't have the background to evaluate which would be better/safer. I hope you will also be able to supply specific part numbers for the transistors (if they are needed).
Thanks
I believe I was already working on such an interface and there was some issue causing problems. If I get a chance tomorrow I will test my theory and post a schematic. Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Thanks for the response, I'm ordering parts soon so I wanted to be sure I had the correct components on hand after I got through the labs.
Post Edited (grindel) : 6/4/2007 11:02:32 AM GMT
I have some ideas, but they are based on some possibly incorrect assumptions on how this connection works.·
What I can gather is that the·"no data transfer" state of·the PSC is a steady +5V.· I'm not sure where the circuit grounds in this case. (high resitance ground in one or both chips?)· When one side wants to transfer data, it grounds the signal to a low resistance ground?
I'll share·what I have come up with if the above assumptions are correct.
The other option I have thought about is desoldering/cutting out the LED so I can use a 10K resister as with other 5V devices.
I just·got my Prop working so I'll try out some ideas and report back as soon as I get parts in.······
I haven’t had time lately to test it…without some sort of level transitioning interface though it’s not going to work. Using a resistor large enough isn’t going to allow it to go low enough to register a logic 0. I remember testing a transistor interface for the RS-232 interface thread in the Completed Projects Forum. That worked, but again, at 5V.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support