Little Step-U "{U}" command problem
Podion
Posts: 90
Hy all
I have a Little Step-U whit a Propeller.
I try to see the position whit the command "{U}" and its not working.
there is the code i use.
I have a Little Step-U whit a Propeller.
I try to see the position whit the command "{U}" and its not working.
there is the code i use.
Comments
your variable "myString" is a local long.
But strings must be defined as global arrays of byte defined in the var-section
If I remember right it is no problem to code
To go on developing I recomend to send the ONE command at a time via Parallax Serial Terminal
seeing how the Step-U reacts and then coding sending this command in SPIN testing again.
After that testing the next command.
best regards
Stefan
Also if you are looking for the 'number' that "{U}" represents you probably want PUB DEBUG_DEC("{U}").
I made the variable has you show and it is not working.
the commande Debug.start(31,30,0,2400) 'rx pin,tx pin,mode,baud rate dont work the i have no OBJ call Debug and the BS2_Functions only accept (31,30)
The Prop is connected like this Serial in - P10 --> as Rx to Prop Serial out - P11 --> as Tx from prop
Busy - P12
The "{U}"is a commande that is sending by the prop to the Little Step-U and after the Little Step-U send a reply to the prop. thats what i understand in the manuel.
[FONT= ]U [/FONT][FONT= ]- SHOW CURRENT STATUS[/FONT]
Syntax {U}
Returns [aaaa,bbbb,ccc]
The {U} command instructs the Little Step-U to send the current values of the Position,Speed and Ramp registers back to the controller. The data consists of enclosing squarebrackets ("[" and "]") containing the three (decimal) values separated by commas.Example: A stepper is being used to move a print head mechanism. In order todetermine the paper width the user has selected, the motor is moved to one stop andzeroed and then moved slowly to the other stop with RAMP set to 0. When the motorstops (BUSY goes low), the position is retrieved with the {U} command. The controllercan then use this value to scale the print head movement commands and ensure that animage will fit on the page.
This code produce a out. but nothing on the display terminal at 9600. But at 2400 the symbol is þ.
The parallax serial terminal (PST) is known as well working. Write a litlle test-prg that is just sending the characters {U} from the prop to the PST.
does the PST display the sended characters?
Do you have a posability to connect your PC directly to the little-step-U via a usb to serial converter?
if yes send the characters {U} from PST to the little-step-U
Does this work?
other ideas: does the little step-step-U need some kind of initialisation?
If yes How does this initialisation looks like? where is the code for it?
Pplease tell us what hardware do you have what kind of measuring equipment DMM, oscilloscope, second USB-to-serial-converter etc do you have?
best regards
Stefan
I used the "Little Step-U" in a project a while ago.I had problems with serial communication with the the Prop.
What solved the problem was to place a "serial level shifter" for serial communications betwwen Little Step-U and the Prop.
The problem in my set-up was the IP1 asd IP not responding as it is suppose to.
I am not sure whether this id the same issue.
I used a level shifter from "Sparkfun".
Siri
PS - I initially used the resistors to connect Rx anf Tx to the prop that did not help. "Little Step-U ----> 5v Prop ----> 3.3V"
The PST dose not display the character sended.
I dont have usb to serial converter.
The little step dont need to bee init.
For now i just have a multimeter has measuring tools.
If you see gibberish on the display perhaps the baud rate doesn't match.
I stayed logged in and looked at your code:
"mystring" is a private variable and will display '0'
"@" refers to a memory location and the value at that location = 'zero'.
"Stepper.str(string("{U}"))" This will only display bytes. "position.speed,ramp" are three comma separated values
I used the "Liile-U-Stepper" using Prop without using the BS2 object.
The attched code is not tested but should work with a liile changes.
Hope this helps.
Siri
PS: need code to display the variables to a screen via PST/serial device etc,