Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

getting data out of a basic program via built in serial port

Hitec robotics including ROBONOVA humanoid, HSR-8498HB servos, MR C-3024 Controllers and RoboBasic
16 postsPage 1 of 21, 2
16 postsPage 1 of 21, 2

getting data out of a basic program via built in serial port

Post by HumanoidFan » Sat Aug 02, 2008 4:23 am

Post by HumanoidFan
Sat Aug 02, 2008 4:23 am

hi,

Another question on the built in serial port.

Has anyone been able to read a variable out of a basic program via the built in serial port?

I was thinking of writing to a location in ram using poke and then reading that memory location from the direct serial port via READ_DATA 0xF7.

I would like to know when a built in motion routine has been completed, so getting feedback out of the basic program would be useful.


Thanks,
hi,

Another question on the built in serial port.

Has anyone been able to read a variable out of a basic program via the built in serial port?

I was thinking of writing to a location in ram using poke and then reading that memory location from the direct serial port via READ_DATA 0xF7.

I would like to know when a built in motion routine has been completed, so getting feedback out of the basic program would be useful.


Thanks,
HumanoidFan
Robot Builder
Robot Builder
Posts: 16
Joined: Wed Mar 26, 2008 2:56 pm

Post by robots42 » Sat Aug 02, 2008 11:54 am

Post by robots42
Sat Aug 02, 2008 11:54 am

I-Bot wrote about this
i-Bot
PostPosted: Sat Mar 15, 2008 2:45 pm
B1 should be zero for PTP Off and non zero for PTP on.
.....

David
I-Bot wrote about this
i-Bot
PostPosted: Sat Mar 15, 2008 2:45 pm
B1 should be zero for PTP Off and non zero for PTP on.
.....

David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by HumanoidFan » Sat Aug 02, 2008 3:12 pm

Post by HumanoidFan
Sat Aug 02, 2008 3:12 pm

Hi,

Is that the correct post? This post is about sync_move and not about getting data out of a basic program via the serial commands!

Am I missing something?

Thanks :D
Hi,

Is that the correct post? This post is about sync_move and not about getting data out of a basic program via the serial commands!

Am I missing something?

Thanks :D
HumanoidFan
Robot Builder
Robot Builder
Posts: 16
Joined: Wed Mar 26, 2008 2:56 pm

Post by robots42 » Sat Aug 02, 2008 3:19 pm

Post by robots42
Sat Aug 02, 2008 3:19 pm

oops! Read your post incorrectly and then copied wrong bit of i_Bots post.
David
oops! Read your post incorrectly and then copied wrong bit of i_Bots post.
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by robots42 » Sat Aug 02, 2008 4:25 pm

Post by robots42
Sat Aug 02, 2008 4:25 pm

Thank you for spuring me on
I have just tried this
knowing that the first variable is at $140 then using $F7 any variable can be read
DIM Var1 AS BYTE
DIM Var2 AS BYTE

$F7 $40 $01 $00 reads Var1
$F7 $41 $01 $00 reads Var2

no need to poke anything
David
Thank you for spuring me on
I have just tried this
knowing that the first variable is at $140 then using $F7 any variable can be read
DIM Var1 AS BYTE
DIM Var2 AS BYTE

$F7 $40 $01 $00 reads Var1
$F7 $41 $01 $00 reads Var2

no need to poke anything
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by HumanoidFan » Sat Aug 02, 2008 4:34 pm

Post by HumanoidFan
Sat Aug 02, 2008 4:34 pm

Nothing like a friendly challenge to spur things on early in the morning or evening in your case!!.

Thanks I will try this, knowing what I want to do via direct serial and built in motions, is var1 the first BASIC variable ? I still want to execute the built in motion sequences via direct serial. example send down 0x00-0x7F to execute motions and then read a variable to indicate when the motion is completed.

I will try this tomorrow.

Thanks! :D
Nothing like a friendly challenge to spur things on early in the morning or evening in your case!!.

Thanks I will try this, knowing what I want to do via direct serial and built in motions, is var1 the first BASIC variable ? I still want to execute the built in motion sequences via direct serial. example send down 0x00-0x7F to execute motions and then read a variable to indicate when the motion is completed.

I will try this tomorrow.

Thanks! :D
HumanoidFan
Robot Builder
Robot Builder
Posts: 16
Joined: Wed Mar 26, 2008 2:56 pm

Post by robots42 » Sat Aug 02, 2008 5:18 pm

Post by robots42
Sat Aug 02, 2008 5:18 pm

Yes Var1 is the first DIMed var
I have already been invoking the template routines by sending 0-32 or more easily sending keys 0-9 and A to W, have to subtract 48 etc to make it work. I thought the Action cmnd lines were to read the keyboard and they had made a mistake in 50 for 48 but 50 was right. Action needs 50 subtracting.
Now I know how to read the Vars adding a higher level processor will be easy.
ETX and ERX are so primitive as to be virtually unuseable.
David
Yes Var1 is the first DIMed var
I have already been invoking the template routines by sending 0-32 or more easily sending keys 0-9 and A to W, have to subtract 48 etc to make it work. I thought the Action cmnd lines were to read the keyboard and they had made a mistake in 50 for 48 but 50 was right. Action needs 50 subtracting.
Now I know how to read the Vars adding a higher level processor will be easy.
ETX and ERX are so primitive as to be virtually unuseable.
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by HumanoidFan » Sun Aug 03, 2008 8:50 pm

Post by HumanoidFan
Sun Aug 03, 2008 8:50 pm

Ok,

So I tried this and it kind of works. I am getting the data, but it some times changes. I am not sure why, maybe because my battery is low or because I used RZBasic on my mac? Really weird. I tried to read the 5th and 6th defined variable, but had some trouble.
I will try again with a fresh battery and then recompile and download on Windows, I think it is the battery.
hmm, could also be the firmware!
Ok,

So I tried this and it kind of works. I am getting the data, but it some times changes. I am not sure why, maybe because my battery is low or because I used RZBasic on my mac? Really weird. I tried to read the 5th and 6th defined variable, but had some trouble.
I will try again with a fresh battery and then recompile and download on Windows, I think it is the battery.
hmm, could also be the firmware!
HumanoidFan
Robot Builder
Robot Builder
Posts: 16
Joined: Wed Mar 26, 2008 2:56 pm

Post by HumanoidFan » Sun Aug 03, 2008 9:42 pm

Post by HumanoidFan
Sun Aug 03, 2008 9:42 pm

ok after a little more testing I found something strange.
If I send down
$F7 $40 $01 $00 I will sometimes get the correct data. not sure why
if I send down
F7 $40 $01
Then I always get the correct data, but sometimes mistakes $01 as writing to the first variable in the basic program and my RN1 will bow.
ok after a little more testing I found something strange.
If I send down
$F7 $40 $01 $00 I will sometimes get the correct data. not sure why
if I send down
F7 $40 $01
Then I always get the correct data, but sometimes mistakes $01 as writing to the first variable in the basic program and my RN1 will bow.
HumanoidFan
Robot Builder
Robot Builder
Posts: 16
Joined: Wed Mar 26, 2008 2:56 pm

Post by HumanoidFan » Sun Aug 03, 2008 10:05 pm

Post by HumanoidFan
Sun Aug 03, 2008 10:05 pm

Flurry of messages.

So now I don't need ETX and ERX.
I can read variables( Motion completed) out of basic program and write in to the basic program to start the motions.



Done.!
Flurry of messages.

So now I don't need ETX and ERX.
I can read variables( Motion completed) out of basic program and write in to the basic program to start the motions.



Done.!
HumanoidFan
Robot Builder
Robot Builder
Posts: 16
Joined: Wed Mar 26, 2008 2:56 pm

Post by robots42 » Sun Aug 03, 2008 11:10 pm

Post by robots42
Sun Aug 03, 2008 11:10 pm

Well I have been running RN from a Stamp BS2, no operating system to get in the way! The C3024 is so sloooww. Using a macro in Br@y'sTerminal I don't get any errors even at a 10ms repeat rate for the macro, Haven't looked to see what the inter byte time is. With the Stamp it needs a 30ms byte pace pause. And yes it does go through a level shifter.

Do you know what the minimum time is between receiving and transmitting a byte is?

I don't think the servicing of the port is up to external control. It is just not fast enough and increasing the baud rate is not going to improve matters any.
Very disappointed.
David
Well I have been running RN from a Stamp BS2, no operating system to get in the way! The C3024 is so sloooww. Using a macro in Br@y'sTerminal I don't get any errors even at a 10ms repeat rate for the macro, Haven't looked to see what the inter byte time is. With the Stamp it needs a 30ms byte pace pause. And yes it does go through a level shifter.

Do you know what the minimum time is between receiving and transmitting a byte is?

I don't think the servicing of the port is up to external control. It is just not fast enough and increasing the baud rate is not going to improve matters any.
Very disappointed.
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by HumanoidFan » Mon Aug 04, 2008 2:38 am

Post by HumanoidFan
Mon Aug 04, 2008 2:38 am

No I don't know what the minimum byte time is but running the basic interp must slow things down a bit. Real-time control is out with the current firmware, but executing motions and finding out when they are complete is in. This will be good enough for the first rev of my driver. I will be implementing a soccer playing behaviour with off board processing of images and motion commands.
Great robot, so so firmware. The BASIC system is really good for starting out.
No I don't know what the minimum byte time is but running the basic interp must slow things down a bit. Real-time control is out with the current firmware, but executing motions and finding out when they are complete is in. This will be good enough for the first rev of my driver. I will be implementing a soccer playing behaviour with off board processing of images and motion commands.
Great robot, so so firmware. The BASIC system is really good for starting out.
HumanoidFan
Robot Builder
Robot Builder
Posts: 16
Joined: Wed Mar 26, 2008 2:56 pm

Post by i-Bot » Mon Aug 04, 2008 8:34 am

Post by i-Bot
Mon Aug 04, 2008 8:34 am

Are you sending $F7 $40 $01 $00 as a string of characters, or do you wait for each character reply before sending the next ?

The C3024 receiver does not use interrupt, and there can be large delays before the UART is read.

The UART receiver has 2 bytes of buffer and the receive register, The fourth byte probably gets lost or corrupts the 3rd byte.

Wait to get at least one character back before sending the fourth.
Are you sending $F7 $40 $01 $00 as a string of characters, or do you wait for each character reply before sending the next ?

The C3024 receiver does not use interrupt, and there can be large delays before the UART is read.

The UART receiver has 2 bytes of buffer and the receive register, The fourth byte probably gets lost or corrupts the 3rd byte.

Wait to get at least one character back before sending the fourth.
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by robots42 » Mon Aug 04, 2008 8:44 am

Post by robots42
Mon Aug 04, 2008 8:44 am

Well I have been running RN from a Stamp BS2, no operating system to get in the way! The C3024 is so sloooww. Using a macro in Br@y'sTerminal I don't get any errors even at a 10ms repeat rate for the macro, Haven't looked to see what the inter byte time is. With the Stamp it needs a 30ms byte pace pause. And yes it does go through a level shifter.

Do you know what the minimum time is between receiving and transmitting a byte is?

I don't think the servicing of the port is up to external control. It is just not fast enough and increasing the baud rate is not going to improve matters any.
Very disappointed.
David
Well I have been running RN from a Stamp BS2, no operating system to get in the way! The C3024 is so sloooww. Using a macro in Br@y'sTerminal I don't get any errors even at a 10ms repeat rate for the macro, Haven't looked to see what the inter byte time is. With the Stamp it needs a 30ms byte pace pause. And yes it does go through a level shifter.

Do you know what the minimum time is between receiving and transmitting a byte is?

I don't think the servicing of the port is up to external control. It is just not fast enough and increasing the baud rate is not going to improve matters any.
Very disappointed.
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Post by robots42 » Tue Aug 05, 2008 1:39 am

Post by robots42
Tue Aug 05, 2008 1:39 am

Put a scope on the signals.
Br@y'sTerminal at 10ms repeat rate for a macro actually repeats at ~110ms with 0.5 ms inter-character gap. Reading a servo position it gets lots of errors just as many as sending from the Stamp. Only sending three bytes so not overrunning the buffer. Sending from the Stamp with 30ms inter-character gap and 100ms inter-message gap still get lots of errors. Basically I think the port is virtually unusable. Pity
David
Put a scope on the signals.
Br@y'sTerminal at 10ms repeat rate for a macro actually repeats at ~110ms with 0.5 ms inter-character gap. Reading a servo position it gets lots of errors just as many as sending from the Stamp. Only sending three bytes so not overrunning the buffer. Sending from the Stamp with 30ms inter-character gap and 100ms inter-message gap still get lots of errors. Basically I think the port is virtually unusable. Pity
David
robots42
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 38
Joined: Sat Jul 05, 2008 1:21 pm
Location: Oldham, Lancs, England

Next
16 postsPage 1 of 21, 2
16 postsPage 1 of 21, 2