Pinguino Forum
Supporting other PIC chips - Printable Version

+- Pinguino Forum (http://forum.pinguino.cc)
+-- Forum: Hardware (http://forum.pinguino.cc/forumdisplay.php?fid=6)
+--- Forum: 8-bit (PIC18F) Pinguino (http://forum.pinguino.cc/forumdisplay.php?fid=42)
+---- Forum: Bugs & Suggestions (http://forum.pinguino.cc/forumdisplay.php?fid=16)
+---- Thread: Supporting other PIC chips (/showthread.php?tid=3157)



Supporting other PIC chips - PMB-NZ - 21-11-2011

Hello
I have been working on a 433MHz control system using a PIC16F and decided to move it to PIC18F due to only having 8 levels of stack in the PIC16F. I looked at the PIC18F2550 but it has a shared SPI and UART pin. Because it has to be very small I decided it was too much trouble and have designed a new circuit board using the PIC18F26K20 which is much like the 18F2550 but with a few minor improvements and no USB. I think the removal of USB was the key to getting the SPI and UART fully functional. I suppose Microchip decided that if you have USB then the UART is less important.
I think Pinguino would be more versatile and maybe more popular if it supported some other PIC18F chips, and some without USB. I would be interested to know what was involved in supporting other chips with a minimum of fuss if anyone knows.
I guess the USB interface and bootloader make it simple to use for beginners and this is very good for most one-off or hobby projects. Maybe anyone wanting to go further is more advanced and can use command line C and ASM tools.

Paul


RE: Supporting other PIC chips - Jean-Pierre - 21-11-2011

Hi Paul

Of course it could be very interesting to port Pinguino on most of the Microchip devices. Instead of making compatible the IDE, I think a good solution could be to make a tool to compile your program for another chip. For example, if you want to build a program for a 26K20, you can test it on a 2550 Pinguino and when everything is working ( most of the program of course ) it could be possible to translate the program to work on a 26k20.
At this moment this is only an old idea !! Fortunately, Regis and his team is working on a new board with a 26J50. On this chip, most of the IO can be redefined so ( I think ) you can affect SPI to some pins and UART to another pin. It could solve your problem.
Regis is working hard to make Pinguino compatible with this chip and, as I know, it's quite ready !!

Jean-Pierre

(21-11-2011, 10:36 AM)PMB-NZ Wrote: Hello
I have been working on a 433MHz control system using a PIC16F and decided to move it to PIC18F due to only having 8 levels of stack in the PIC16F. I looked at the PIC18F2550 but it has a shared SPI and UART pin. Because it has to be very small I decided it was too much trouble and have designed a new circuit board using the PIC18F26K20 which is much like the 18F2550 but with a few minor improvements and no USB. I think the removal of USB was the key to getting the SPI and UART fully functional. I suppose Microchip decided that if you have USB then the UART is less important.
I think Pinguino would be more versatile and maybe more popular if it supported some other PIC18F chips, and some without USB. I would be interested to know what was involved in supporting other chips with a minimum of fuss if anyone knows.
I guess the USB interface and bootloader make it simple to use for beginners and this is very good for most one-off or hobby projects. Maybe anyone wanting to go further is more advanced and can use command line C and ASM tools.

Paul




RE: Supporting other PIC chips - PMB-NZ - 22-11-2011

Hello

Thank you for your comments.

It is a problem when there are so many devices with minor differences.
I wondered about configuring the underlying tools to support more devices, like a standard gputils installation, then have Pinguino produce a hex file that can be uploaded using ICSP if USB is not available. I don't know.

I think Arduino and Pinguino are very good and it is not a problem using PIC18F as the minimum device. Having to use USB on the device is very good for education and hobby but is limiting for small embedded applications. Maybe one of the reasons Arduino has done so well is that it does use USB and is simple; if you don't count all the problems with Windows and USB drivers Wink

Years ago I asked Microchip about PIC development on Linux and they said it would not happen as there was no demand. Maybe they have now seen a demand.
Yesterday I installed the Beta of MPLAB-X for the first time on a Ubuntu Linux machine, which went surprisingly well. The instructions were vague and I was not expecting it to be so easy. This lead me to discover that my ICD-2 and Pickit-2 programmers are now out of date; so I am getting a Pickit-3, which is supported by MPLAB-X. I was using Windows to drive the ICSP programmers as I have not found a reliable Linux ICSP software. Maybe now I can leave Windows behind. I see that the latest version on gputils has just recently added support for the 26K20 and family. Now I must work out how to upgrade gputils. It is never as easy as it should be Smile

I really have to develop in the final processor as I have a custom circuit board and my project involves many interrupts, one nested interrupt and critical timing to manage fast SPI, UART, PPM (decoding and generation), oversampled ADC and I2C.

Paul

(21-11-2011, 07:12 PM)Jean-Pierre Wrote: Hi Paul

Of course it could be very interesting to port Pinguino on most of the Microchip devices. Instead of making compatible the IDE, I think a good solution could be to make a tool to compile your program for another chip. For example, if you want to build a program for a 26K20, you can test it on a 2550 Pinguino and when everything is working ( most of the program of course ) it could be possible to translate the program to work on a 26k20.
At this moment this is only an old idea !! Fortunately, Regis and his team is working on a new board with a 26J50. On this chip, most of the IO can be redefined so ( I think ) you can affect SPI to some pins and UART to another pin. It could solve your problem.
Regis is working hard to make Pinguino compatible with this chip and, as I know, it's quite ready !!

Jean-Pierre




RE: Supporting other PIC chips - tochinet - 19-12-2011

(22-11-2011, 03:36 AM)PMB-NZ Wrote: I think Arduino and Pinguino are very good and it is not a problem using PIC18F as the minimum device. Having to use USB on the device is very good for education and hobby but is limiting for small embedded applications. Maybe one of the reasons Arduino has done so well is that it does use USB and is simple; if you don't count all the problems with Windows and USB drivers Wink

...

I was using Windows to drive the ICSP programmers as I have not found a reliable Linux ICSP software. Maybe now I can leave Windows behind.

Unfortunately / sadly enough, this is reality : I and many other arduino users newer saw "all the problems with Windows" you expect, arduino installs and works very good both on Vista and old 2000 machines, while you can't find any good ICSP software on linux... :-( Strange that arduino apparently works on Windows, MAC and Linux...

I don't want to advocate or critic anything, but look for comparison at Paul's excellent work for the teensy : it is not supported by Arduino people, but its "teensyduino" extension works for arduino 0022 as well as 1.0. In the other hand, installing pinguino on the 2000 machine failed (some python related error). Hence while I wanted to migrate to pinguino, I'll finally go teensy instead (or STM32 later, even if Maple IDE is also not without issues ;-(

So my advice to the pinguino admins : consider what is best : continue with little critical mass or join the mainstream. Wouldn't it be possible to change arduino IDE so that it compiles for PICs ?