View unanswered posts | View active topics It is currently Tue Sep 02, 2014 4:26 am






Reply to topic  [ 8 posts ] 
Prototype Board 
Author Message
Rookie

Joined: Thu Jul 02, 2009 9:02 am
Posts: 25
Post Prototype Board
I have had a prototype board for a year now and have no clue how to use it. i have looked at the driver api documentation for it, and i don't think i understand what the mask stuff is.
i know i should probably know about this stuff, but i don't so does someone else? i would love to use the Prototype Board for all our sensors in FTC. not to mention i have my own Prototype Bard which i would like to use with my electronics breadboard. i do have some experience in electronics, but not much in the way of digital logic circuits. mostly stuff like simple oscillators and blinking lights.


Wed Dec 09, 2009 11:34 am
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 615
Post Re: Prototype Board
I assume you mean the HiTechnic prototype board.

If you searched the web then you'll probably find some examples of use by other people. Also check out the "3rd party sensor" driver package by Xander Soldat.

And you should try the HiTechnic site if you want hardware help with their sensor.


Wed Dec 09, 2009 4:22 pm
Profile
Rookie

Joined: Thu Jul 02, 2009 9:02 am
Posts: 25
Post Re: Prototype Board
i've already looked through all that stuff. thats why i'm asking on the forums now, because no one really explains what this for example really means: inputs = HTPBreadIO(HTPB, 0x3F);
HTPB makes sense. its on the configuration...
but what does 0x3F mean. i'm pretty sure that this is 63 in decimal value... but neither hitechnic, or Xander Soldat seam to find it necessary to explain this part.

so basically my question is more specifically: is there a place that explains the 3rd party Hitechnic Prototype Board Driver for dummies? if not, would someone be able to just give a brief explanation on how to use the the Prototype Board in RobotC?

i'm not talking about adding a super powerful Laser Range finder(although come to think of it, that would be a cool addition to our FTC robot), i'm just talking about adding extra light sensors and switches. or maybe some LED's witch can show us the status of our robot from a distance.


Wed Dec 09, 2009 4:56 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3209
Location: Rotterdam, The Netherlands
Post Re: Prototype Board
There is currently no tutorial on how to use the drivers. It's being worked on but a lot of other things have taken precedence.

As for what a mask is, think of it as a way to to select certain bits, or channels in this case. If you look at the number 0x3F, you'll see that's 63 in decimal, or 111111 in binary. There are 6 channels, so 111111 selects all. 11000 would select channels 5 and 4, 001100 would select channels 2 and 3. Do you see a pattern?
Code:
HTPBreadIO(HTPB, 0x3F);

reads channels 0 through 5.
Code:
HTPBreadIO(HTPB, 0x03);

reads channels... ? 0 and 1.

These things are explains on the HTPB's product page, except they use decimals, not hex or binary. For more info on masks in general, check out this article here: http://en.wikipedia.org/wiki/Mask_(computing)

Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Dec 09, 2009 6:10 pm
Profile WWW
Rookie

Joined: Thu Jul 02, 2009 9:02 am
Posts: 25
Post Re: Prototype Board
Thanks. that pretty much answered all my questions at once :-)

but i also have one new question now.

if you are reading all 6 channels, what exactly does it output? does it output another mask?


Wed Dec 09, 2009 6:16 pm
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 615
Post Re: Prototype Board
mightor wrote:
As for what a mask is, think of it as a way to to select certain bits, or channels in this case. If you look at the number 0x3F, you'll see that's 63 in decimal, or 111111 in binary.

Xander:
By the way, ROBOTC now supports binary numeric constants. I recall the syntax is 0bXXXXX where "X" is either a 0 or a 1. But I may have used a different syntax. Someone requested it a while back and it was pretty easy to add and a fairly common extension to C.

Another change made at the same time was to accept arbitrary underscores in number constants so 123456 and 123_456 are the same thing. At least I think this was the syntax.


Thu Dec 10, 2009 12:41 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3209
Location: Rotterdam, The Netherlands
Post Re: Prototype Board
Dick,

Yeah, it was something I asked for after seeing it being used in a couple of other microcontroller compiler environments :) Some others chimed in and said that it would be very handy. I didn't realise you had added it in the meantime. Very handy to know!

RP,

Yes, it will output another "mask"-like number. Use the info from the Wiki page I gave you before to find out how to check if a certain bit is set or not.

Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Dec 10, 2009 2:32 am
Profile WWW
Expert

Joined: Sun Aug 19, 2007 2:43 pm
Posts: 136
Location: New Jersey
Post Re: Prototype Board
still trying to figure out how i may use the DAC_MODE_PWMVOLTAGE on O0 and 1 to drive a servo... got it go for a bit, could not make it go back... wonder if any has tried it.


Thu Jan 31, 2013 1:57 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.