View unanswered posts | View active topics It is currently Fri Oct 30, 2020 3:18 am

Reply to topic  [ 4 posts ] 
Help with RobotC and the PIC platform 
Author Message

Joined: Wed Feb 09, 2011 1:08 am
Posts: 27
Post Help with RobotC and the PIC platform
Is there anyway to find out what standard functions are provided with Robot C for the PIC platform? when I switch to platform PIC my code for Cortex does not compile, this primarily due to the string functions which are not supported with PIC, but writedebug stream does not work either. how do you get debug output? It seems that there is not much support for the PIC, and finding out how to do basic capabilities like read and write to the serial port is beyond me right now. I have code for the Cortex to provide an alternate commend entry and I would like to port it to the PIC so I can have wireless control other than the Rx1 & 2 ports. I want to use my PIC as my second robot in the robot to robot communications. how can I get some information on the basics? I reviewed the wiki and the tutorials, samples etc. but I can't find information on basic capabilities like writing to the debugger.

Any help would be appreciated. Thanks Kb

Sat Nov 24, 2012 8:12 pm
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 620
Post Re: Help with RobotC and the PIC platform
The Cortex has 384KB of Flash, the PIC has only 32K.

The ROBOTC VM in "barebones" mode takes about 25KB of flash - This includes stripping out support for Strings, Recursion, Debug Stream, Sound Support, a few other less used features (Datalog, I2C, Long Variables, Float Variables)

The VEX PIC does support a single serial port (which is used for the VEX LCD normally) - The commands are pretty easy to use: (works for PIC as well)

Are you looking to use the VEX PIC as a motor expander (i.e. use a communication like serial to send commands to the PIC to turn on/off motors)?

Timothy Friez
ROBOTC Developer - SW Engineer

Tue Nov 27, 2012 11:03 am

Joined: Wed Feb 09, 2011 1:08 am
Posts: 27
Post Re: Help with RobotC and the PIC platform
Hi Tim,

To answer your question I had 2 ideas in mind, the first was to use the PIC as a second 'robot' in a multi robot comm pair, which sounds like that might be a bit more of a challenge than I had originally thought. The second would be to have a basic joystick to motor or command to motor capability to support more of either a motor controller functionality or just a remotely controlled platform which fed it's basic sensor data back over a link for another platform to do the computing on. and relay the commands back to the PIC. That link could be wireless, or a short hardwired connection (via the serial ports) to another board like an Arduino. I think your answer has given me enough hope to get started on this again. (i.e. serial port is supported)

I started the effort inspired by the multi robot comms project, and now I'm trying to find a reasonable functional purpose for the few PIC's we have left in the inventory.

So that said, when I tried to compile and download my basic serial port code for the cortex to the PIC I discovered the PIC doesn't support things like Strings which my cortex code depended on. A little disappointing, but I certainly understand the constraints, and appreciate the effort you went through to get the compiler to work with the PIC as well as all the other platforms.

My question is how (other than trial and error) can I find out what standard C functions are available on the PIC platform? the wiki page has very little information on the PIC platform. For example my 'test bed' is a small not so square bot with 2 drive motors and 2 optical shaft encoders, the PIC and an XBee. When I found out that the PIC platform doesn't support longs (Ref the help file on data types which was very helpful to understanding the platforms the data types were available on) But the Function Library window which fills in dynamically when you compile the first program for a platform was very sparse, in fact the serial functions disappear when switching from Cortex to PIC. So although the PIC has a user configurable serial port it looks from the function list to be unsupported. Thanks for clearing up that one. My more general question was what else might be available on the PIC but not currently in the Function List Sorry I asked the question a little restrictively. i.e. what standard C functions are supported. Is the function library list supposed to be the comprehensive list of what's available? if so it's missing the serial functions at least. That would be helpful to know.

I'm learning a little more all the time about how to use the in built tracing functions in Robot C to find out some of these answers, but short of trying and succeeding / failing I'm not sure how to determine which functions would be native to the PIC.

As I was writing this response I was checking out some capabilities with the 3.54 version of the compiler and I think I understand better how types are define behind the scene for sensors and such i.e. a long (intrinsic word ) on cortex becomes a short (intrinsic word ) on the PIC for retrieving timer values.

One last immediate question, I see on the Motors and Sensors setup for the serial port options like X-Bee Zig-Bee / Wi-Fi, etc. But I have not found any documentation related to those selections. I therefore set the serial port to not used, and then initialize it myself in the user code initialization section. (setBaudRate) Are you supporting the serial port configurations for those sensors on PIC or Cortex yet? where would we find out how to use those sensor types ? i.e. what functions are provided to interface to the smart sensor? or is this future capability we will see later?

Cheers Kb

Wed Nov 28, 2012 10:08 am

Joined: Wed Feb 09, 2011 1:08 am
Posts: 27
Post Re: Help with RobotC and the PIC platform
I thought of one more question for the time being,

Given that resources are (more) limited on the PIC, is there any way to tell if I have written too big a program for the PIC? or alternatively is there some indication of the free resources on the PIC after I compile a program for it? I would like to know before I try to download. -but even knowing after download would still be useful, so I could monitor the 'Flash / ram' in use and try to avoid overloading the PIC. If there is a way to get system resource information / program file size so I can try to avoid issues related to over subscribing the PIC I'm assuming from your earlier post that user programs would need to fit in less than 7K of flash? (32-25=7)?

From the VEX website the PIC has:
Microchip PICmicro PIC18F8520

Speed:10 MIPS (Million Instructions Per Second)
RAM:1800 bytes + 1024 bytes EE2
Flash:32K program space

so managing RAM and Flash space proactively would be a bonus.

Cheers Kb

Wed Nov 28, 2012 10:30 am
Display posts from previous:  Sort by  
Reply to topic   [ 4 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.