View Single Post
  #14   Spotlight this post!  
Unread 08-05-2014, 23:56
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: How to loop peices of code forever?

Quote:
Originally Posted by yash101 View Post
It is sad that the VEX cortex does not support threading or tasks . It would be nice to run tasks parallel to each other. Does anyone by chance know how to bypass RobotC and actually access C10 (I think that's what it runs)? We are doing VEX robotics in eng. class, but I want to do things that are a bit harder!
There's quite a bit of confusion here, let me try to clear it up:


There is no inherent support for Tasks native to any processor, really. Tasks are almost always implemented by an operating system running on top of the processor, which runs a scheduler to schedule tasks when they are ready (on embedded systems they are usually scheduled by time rate). This is not a function of the processor hardware. However, there are ways to do tasks without an OS. Many micros have timers, which can be used for a number of things, including generating an interrupt request when they expire. This can be used to create a task by running code in the interrupt service routine. I usually see this used for very fast tasks, such as the OS kernel, but in basic systems it can be used to run fast code directly.

The Cortex has an ARM Cortex processor, so naturally it would run ARM opcodes. There is no real 'language' assigned to opcodes except the assembly language, which just gives meaningful names to opcodes (e.g. load, store, ... operations). C is a high level language on top of that, with a compiler that takes the C code and compiles it into opcodes for the particular processor family (in this case, ARM opcodes). As long as you can find a compiler to generate the opcodes for your processor, the language is usable.

RobotC does not actually use C standard code, it's quite bad with it (but it's gotten a lot better over the years). RobotC compiles using an internal compiler to RobotC bytecode, which is then run on a virtual machine on the Cortex. So, on the Cortex, the RobotC bytecode (opcodes) is executed by the RobotC interpreter, which is written in some language which was compiled into ARM opcodes. RobotC itself does have tasks, you can have many parallel threads, but you can't control the task rate precisely.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack