NMS Navigation Data Grabber icon NMS Navigation Data Grabber — Query NMS lidar scan data by angle, with control commands for range, arc extremes, and obstacle checks from the latest scan. Try it →
Asked — Edited
1 Participant

How To Mask The Serial 8Th Bit

Hi all and DJ,

I'm trying to figure out the syntax to mask the 8th bit of a packet serial command from EZ-B to RobotClaw Motor Controller, any help would be appreciated if it's possible on the EZ-B.

On other MCU's that I have I use this format...

Serout P15, i19200, [128, 0, 127 (255 & 0x7F) ]

Serout - well that's the command for output from the serial port,

in EZ-b that would be SendSerial.

P15 - is the port ...EZ-B D0

i19200 - is the baud rate...EZ-B just 19200 or whatever baud i use..

The 128, 0, 127, (255 & 0x7F) is "address, command, address, (checksum & 0x7F)

the 0x7F is the Hex code to mask the 8th bit.

Sooooo...

EZ-B code...

SendSerial ( D0, 19200, 128, 0, 127, (255 & 0x7F )

but it won't accept the "(255 & 0x7F)"

clear as mud eh!

:)


ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

#9  

The code is for an Atom Pro 28 to RobotClaw , there must be a reason why it's done that way.

#10  

@DJ

I've setup the RobotClaw and EZ-B and all seems well so far THANKS, and thanks for putting up with my thick brain, I've been using Basic Atom pro for so long that I couldn't see how just the decimal number would work, it's never used that way for programing the Pro.

And now for another question...

This has probably been asked, can all the D ports be used for serial in and out?

And is there a command like "ReceiveSerial" or "GetSerial" etc.

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#11  

There is no GetSerial. There are not enough free clock cycles to receive serial input during PID execution. Our new hardware guy is working on an EZ-Bit for that:)

#12  

Ok,

Why doesn't this line work with the variables

SendSerial (D0, 38400, 128, 6, "$L" , "$CS6" )

The variables work when using the print command but not in the line of code

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#13  

SendSerial (D0, 38400, 128, 6, $L , $CS6 )
#14  

Won't work.....error: not a valid format confused

Author Avatar
PRO
Synthiam
LinkedIn Thingiverse Twitter YouTube GitHub
#15  

Ah, fixed for the next release:)