New Controller programmable in C

here is the latest email from first in it tells the truth with the new O/I and RC.

“The rumors are true; a new control system is coming. The new RC has a user programmable Microchip PIC” controller operating at 10 MIPS, gives direct access to I/O, has interrupts, and is programmable in C. Please do not contact Innovation First requesting information as more details will be available at www.InnovationFirst.com in the next few weeks when the product ships."

Thats a clipit form Bob Hammond’s listserv email announcement!

~Michael

SWEET. I wonder what compiler they will be providing. I hope it is either Metrowerks, CCS, or Hi-Tech.

Any guesses on whether we can use gcc or derivitive with a library or something?

If the new controller has a PIC Microchip on it then I would assume the C compiler will be the one from Microchip

I will have to check their website and see if you can get their C compiler for free. I know the assembler compiler and simulation tools for the Microchip devices are available for free.

PIC chips are pretty cool. You can do a lot of stuff with them fairly easy.

looked at MicroChip’s website. They do have SW development tools that include a C compiler and an assembler

It looks like its not a free download however, so if this is what FIRST is planning on using, I guess the SW will be part of the kit.

You can look around the MicroChip website to see what kind of stuff they have - here is a page that has one of their C compilers:

http://www.microchip.com/1010/pline/tools/picmicro/code/mplab17/index.htm

At Tech, an I’m sure at most other universities, we have embedded microcontroller classes. One of the classes uses the PIC18F452. Here is a link to the class website. If you click on PICbook you can access a few free downloads for this pic (not sure about the compatability with others). Take a look around, you may find something you can use. If not then as KenWittlief said, check the Microchip website.

http://piclab.ece.gatech.edu/

I found the Microchip C compiler package at DigiKey

its $395.

if thats what we will be using, guess Ill wait till we get it from FIRST :c)

If it’s a standard PIC controller… is there any reason we have to wait for their compiler?

Can’t we just use an existing one?

Whoa!! since when does mirochip have their own compiler?

*Originally posted by KenWittlief *
**I found the Microchip C compiler package at DigiKey

its $395.

if thats what we will be using, guess Ill wait till we get it from FIRST :c) **

The MPLAB C18 C Compiler has a free demo available from Microchip’s website.

http://www.microchip.com/1010/pline/tools/picmicro/code/mplab18/index.htm

Ok, I’m not good with this kind of stuff, so I have a few questions

What does 10MIPS mean?

What does it mean by “direct access to I/O”?

lastly, what does “has interrupts” mean?

*Originally posted by Ryan Foley *
**Ok, I’m not good with this kind of stuff, so I have a few questions

What does 10MIPS mean?

What does it mean by “direct access to I/O”?

lastly, what does “has interrupts” mean? **

MIPS is million instructions per second

Direct access to I/O means that you can access the pin inputs and ouputs for the controller and read and/or manipulate their values directly.

Interrupts are what a controller uses to perform other tasks outside the main program loop. The processor goes off for a while to process the interrupt and comes back to the main code where it left off (Could be used for sensor polling etc).

You should grab a good book on microcontrollers if you are really interested. It should explain all this stuff. Or just do a search on google.

*Originally posted by skyman9000 *
**MIPS is million instructions per second

Direct access to I/O means that you can access the pin inputs and ouputs for the controller and read and/or manipulate their values directly.

Interrupts are what a controller uses to perform other tasks outside the main program loop. The processor goes off for a while to process the interrupt and comes back to the main code where it left off (Could be used for sensor polling etc).

You should grab a good book on microcontrollers if you are really interested. It should explain all this stuff. Or just do a search on google. **

Thanks.

So interrupts effectively facilitate good function jumps then?

*Originally posted by djcapelis *
**So interrupts effectively facilitate good function jumps then? **

I’m not sure exactly what you mean by a “function jump”, but the way I understand it, when the system encounters an interrupt, it executes a predefined function, and then goes straight back to where it left off.

At the machine level, the system pushes the program counter (the address of the instruction it was at before it received the interrupt) into a stack, stores any important information, and jumps to the code of the function that should be run on the given interrupt. Once the interrupt’s code has completed, the original address is popped out of the stack, and all of the aforementioned important information is put back in its original place.

I hope I got that all right. If not, please correct me.

Function jump, as in jumping to a function.

For example… (ignore the mix of c++ and the bad syntax, haven’t used c-based programming in a bit)

void my_fuction();

void my_fuction()
{
cout << “Doggies run at midnight” << endl;
}

int main()
{
cout << “Jumping” << endl;
my_function();
return 1;
}

When the program calls my_function it would make a function jump and go to another place in the code, I believe… exactly as you described.

This can be hacked in PBASIC with GOTOs but isn’t elegant in the least. So interrupts allow you to employ properly coded functions then… am I correct?

Ah. I don’t think so. What you’re doing is calling my_function() from within main(). What an interrupt would look like is this:

void main(void) {
/* these aren't the droids you're looking for, go about your business */
}

void interrupt1(void) {
/* do this stuff when interrupt 1 is encountered */
}

void interrupt2(void) {
/* do this stuff when interrupt 2 is encountered */
}

So, you wouldn’t call interrupt1() or interrupt2() from anywhere in main() (although you could, if you wanted), but whenever the system received an interrupt signal, it would stop what it’s doing in main(), and execute (or jump to, if you prefer) the predefined interrupt function, and then come back to main(). Another way of thinking of it might be to think of the system inserting a function call into the program at any point, depending on when it receives the interrupt signal. Whenever that signal is received, it automatically executes this predefined function.

Hrm. I just repeated myself a few times. I hope it makes some sense.

As for PBASIC, that language has subroutine functionality (through GOSUB and labels), which is sort of like a function, but it doesn’t take any arguments and it doesn’t return any value.

Oh, ic… an external interface triggers the interrupts, not the program itself.

I get it now… thanks.

(BTW, declaring main as void violates the language standards, technically that isn’t legal. Compilers compile it anyways because people like breaking it… but exit codes are a good thing. Anyways…)

(Also, in case you were wondering where the jump part came from, I’d guess it’s roots are probably in the ASM jmp instruction.)

Ah. I should have made that more clear.

Glad I could be of service, though.

(I never claimed to adhere to standards :slight_smile: )

(Yeah, it is)

I wanted to answer the question as to what 10 MIPS means: absolutely nothing. MIPS is really just a meaningless relationship because it doesn’t show what type of instruction was executed. It could’ve been a series of NOP’s. It can be rather frustrating trying to figure out how fast a CPU is just by manufacturer’s information.

Matt