Linux and new microcontollers.

Love the new controllers, using linux, want to program.

Working on building up a software list for them, if there’s anyone else interested I thought I’d put it in this fourm, also, for those that have any links to share, here’s a thread to post. :slight_smile:

First thing I’ve found so far just appears to be fairly basic… no C libs yet.

http://www.brianlane.com/picprg.php

http://gputils.sourceforge.net/

Seems like a good start, though it’s just an assembler. The program at http://www.brianlane.com/picprg.php seems to use a parallel port to connect to a programmer, while the RC has a serial port… which does the programming somehow.

Would be nice to use linux for the dev this year, and I hope there’s a way.

Have you used it before? There was support for PBASIC from a few places… heh, some of them developed by robotics teams. :slight_smile:

worst comes to worst I’ll be downloading my IDE of choice for windows… gVIM. :wink:

Anyways, also came accross this for the C stuff:
http://massmind.org/techref/microchip/language/cs.htm

I don’t have the experience with microcontrollers to tell how useful it is… but it looks promising.

PBASIC support was just some code wrapping the binary library parallax provided. In other words, it sucked. (well, more specifically, they didn’t update the library when they were releasing their ide betas)

PICs on the other hand, are a bit more standard, so even with less support from the people who make things, there’s a chance we’ll get decent support. (that is, if you ignore the serial port programming issue, which I’m not sure about.) For assembly anyway. Getting a C compiler maybe pushing it. :wink:

I hope I’m wrong about the C compiler though.

It appears you might be.

http://www.yty.net/pic/enindex.html

Nice little walkthrough.

Also, I think I saw some scattered links to serial programmers too.

Im a little fuzzy on what you mean by ‘using’ Linux with the new controllers.

MicroChip has a complete integrated SW development tool set, which you would install and run on a PC (like you did with the basic stamp editor)

I dont know if the Microchip development SW will run on a Linux system, if thats what you mean

I cant think of any reason why you would want to have Linux run on the robot controller itself (if that is what you are talking about) - since the RC doesnt have a disk drive or network, or video… there really is no need to have an operating system running on the PIC chip inside the robot.

I’m pretty sure they’re talking about using Linux as a development environment.

The problem with this is that source and libraries are compiler specific, generally (speaking of embedded systems, uPs and uCs), so using a compiler other than what we’re provided might be rather difficult. This is not to say that it’s impossible to port the software, itself, but I think it would just be more trouble than it’s worth.

Also, Linux-based assemblers, simulators, and programmers (software) are fairly common. Here’s what I got from a query of apt (Debian), just now:

fotoplasma@ziggomatic:~$ apt-cache search microchip
gpsim - Simulator for Microchip’s PIC microcontrollers
gpsim-dev - Libraries needed only for building gpsim components
gputils - GNU PIC utilities
nitpic - Simulator for the Microchip PIC16C84 microcontroller
picasm - Assembler for the Microchip PIC-family Microcontrollers
picp - command line utility to drive a PICSTART programmer
simulpic - Microchip PIC device simulator

I don’t think any of them are applicable to our situation, though.

The assembler that comes with gputil should be compatible with mpasm stuff, I think. There is no apparent free (as in source) compiler for linux so compatibility with the compiler is a problem we’d like to have.

Or, if you use the shareware compiler from http://www.picant.com/c2c/c.html , compatibility is a problem you already have.

Anyone wanna try using WINE? (I’ll run it through wine once we get the edu-rc kit and software)

When the time comes, if that doesn’t work I’ll also nab winex (CVS version) and try that. Also, if you do get it running, could you post your datestamp for the release? Wine frequently experiences regression…

You guys might want to take a look at this page: http://www.piclist.com/techref/microchip/language/cs.htm

[edit] Nevermind, this page is the same as one posted above, I guess…

I cant think of any reason why you would want to have Linux run on the robot controller itself (if that is what you are talking about) -

Although that’s not what this thread is about, there is a nice set of tools for the Lego RCX called BrickOS. This suite runs a stripped down Linux kernel on the Lego RCX.

If you have a full-up OS running on your embedded system, you have access to tools and hardware abstractions which may make your life easier.

If we stick with this new PIC for many years, I suspect that someone will inevitably port the BrickOS (or some such) over to it. Although that will depend on how much memory and storage the system has (relative to the RCX).

One of the neat things about BrickOS is the Lego Network Protocol (LNP), which allows TCP/IP networking to be done over the serial IR tower link. Can you imagine running TCP/IP over the radio modem through the dashboard to a wireless ethernet appliance. People from all over the world could log into a competition robot while it competes!

The advantage to using an embedded Linux would be to use the execi abstraction. This allows you to set up event driven interrupt handlers from inside your C program.

The scheduler is a built in part of the OS. Otherwise, you have to write your scheduler yourself.

To stay on the topic of this thread, CCS says they have a development suite for the PIC which runs under Linux. I have not dug down to the point that I have actually found this product or seen how much it costs.

Although this year is probably going to have a lot of people dreaming up cool stuff to do with the new features of the modern RC, I suspect that we’re going to have to wait a couple of years before the full potential of this new programming power comes through.

Well, I have been looking into this for a while now, and it seems that all PIC programming projects for linux/unix are assembly and for earlier chips than the one in our RC’s. Most are for 16F series, while ours is 18F. As far as I can tell, everyone should get their dual boots working as soon as they can… (myself included, with an empty 5 gig partition just waiting for a W2K boot…)

Wha? Give in that easily? The only apparent problem right now is the conversion from C to assembly. <s>The free C compiler I saw only does 16f, but someone might just add 18f support by the time we get to January.</s> If not, then wine might do the job. Hopefully, we can just make a sort of wrapper around the compiler that sets things up and runs wine.

And if all else fails, assembly doesn’t look that hard. :wink:

I don’t dual boot, I just have two hard drives with windows on one and linux on the other. It’s annoying to switch around so I have a good reason to hold on to my uptime. Last year, I just wrote most of the code on my laptop, moved it over to the engineer’s laptop and finished things there.

Edit: I just checked again, and it looks like the SDCC does support 18f. I dunno if it does 18f8520, but it’s that much more likely to work now. Now the problem is that SDCC probably uses a different C than the “official” compiler.

I’m using SDCC for a chip in my High Tech class (www.pjrc.com), and it seems to be pretty easy to use, even on Windows (yeah, it’s pretty weird using Linux commands on Windows :p). I can’t say I’m experienced with it, but what I’ve done has been pretty easy. And it’s all happy CLI :).

I’ve been programming PIC 18F452 for almost a year and have a pretty good understanding of the chip now. The 18F8520 is so new, I haven’t found any development/evaluation boards for it yet.

The MPLABS IDE is a simple IDE, but eventually I switched to Komodo as it works with CVS (concurrent versioning system). For programming, I’ve been using the Melabs EPIC programmer.

Hi-Tech sells a C compiler for the PIC which will come with a Windows version and a Linux version, but is expensive. C2C is cheaper. The CCS compiler is a popular choice, but isn’t fully 100% ANSI C.

No SDCC or GCC port yet, but I’m still hoping this will change soon as the incentive is there. The 18F now has enough of a stack to make this possible now. A GCC port would make BrickOS on the PIC possible.

Each compiler accesses the PIC hardware with different semantics, so changing compilers means you have to rewrite the code.

As for an IDE, you have many choices besides VI (vim) and Emacs/Xemacs such as Eclipse, Kate, KDevelop, Komodo (ActiveState.com) and Kylix. I probably missed a few, but these are the ones I’m familiar with. Most of these can be extended to support the compiler and a download utility.

For programming a PIC, there’s PonyProg and PP06, neither of which I’ve tried yet as I haven’t yet completed my Windows to Linux conversion on my last Windows box.

There is no Linux port to the PIC chip. It just isn’t possible, but the smallest 16 bit Linux is ELKS for the 8086 and takes up 32K. Don’t know if there are any real-time embedded operating system for the PIC yet, particularly of the open source variety. Unless somebody is porting eCos this very minute.

Oh, and I’ve been programming my Lego Mindstorms in NQC, which is a subset of the C language, on Linux.

Btw, check this out: http://www.penguicon.org

Linux rocks! Windows sucks. Why pay the Microsoft tax on your computer?

The evaluation board for the PIC18F8520 is part number DM183020. The demo board comes with a different part, but its supposed to work with the 18F8520. Its out of stock at digi-key, but normally $49.00. The chip itself is $11.28. Its a companion to the MPLAB ICD-2 so I’m not sure whether you can program it without that.

*Originally posted by seanwitte *
**Its a companion to the MPLAB ICD-2 so I’m not sure whether you can program it without that. **

The microchip page refers to a serial bootloader. I would assume that this is how you program it in the demo board (and probably how we do it in the control system also).

*Originally posted by Joe Ross *
**The microchip page refers to a serial bootloader. I would assume that this is how you program it in the demo board (and probably how we do it in the control system also). **

The demo board does not include the 13V power supply needed to program the chip. The pins used by the ICD modular jack are well documented, so you can probably modify the board to work without the debugger.

the only thing that makes me apprehensive about using these tools are that FIRST has said (or maybe it was innovationfirst) that microchip is providing a modified version of the C18 libraries to work with the IFI controllers…so i’m not sure these compilers would have the right libs/directives needed to properly compile a program for the new controllers.

i’m not saying these tools WON’T work, im just saying it’s a possibility…i’d hate to get familiarized with an IDE/compiler and then not be able to use it :frowning:

Then just copy the libraries over and link to them. No one said you had to use the libraries included with the compiler (sdcc).

Not to say there won’t be any work getting files distributed by IFI to work with SDCC/MPASM/etc. We’ll see.