Search in Pinguino World !!

Sunday, December 25, 2011

How to use interrupt on Pinguino32

Pinguino32 doesn’t support interrupt routines without writing a code in an assembler file. We decided to open interrupt to everybody. To do this, we used some of the special attribute directive of GCC. Now you can deal with Interrupt without assembler.

This example show how to use the Timer 1 to increment a counter.

// Using interrupt with Pinguino32
// Jean-Pierre MANDON 2011

#include

unsigned int counter=0;

void ISR_wrapper_vector_4(void) __attribute__ ((section (".vector_4")));
// Put the ISR_wrapper in the good place

void ISR_wrapper_vector_4(void) { Tmr1Interrupt(); }
// ISR_wrapper will call the Tmr1Interrupt()

void Tmr1Interrupt(void) __attribute__ ((interrupt));
// Tmr1Interrupt is declared as an interrupt routine

// define here the code to execute when an interrupt occure
void Tmr1Interrupt(void)
{
if (IFS0bits.T1IF) // Timer Interrupt flag
{
TMR1=0; // reset the timer register
IFS0CLR=0x10; // Clear the timer interrupt flag
counter++; // increment the counter
}
}

// configure timer 1
void init_timer1(void)
{
IntConfigureSystem(INT_SYSTEM_CONFIG_MULT_VECTOR); // interrupt mode (interrupt.c)
T1CON=0; // reset timer 1 configuration
TMR1=0; // reset timer 1 counter register
PR1=0x9999; // define the preload register
IPC1SET=0x7; // select interrupt priority and sub-priority
IFS0CLR=0x10; // clear interrupt flag
IEC0SET=0x10; // enable timer 1 interrupt
T1CONSET=0x8010; // start timer 1 and set prescaler
}

void setup()
{
init_timer1();
}

void loop()
{
CDC.printf("%d\n\r",counter); // counter is incremented at each timer 1 overflow
delay(1);
}

Be careful, some interruption are already used by Pinguino32. Vector_8 (timer 2) is used by the function millis(). vector_24 (Serial1 interrupt) and vector_32 (Serial2 interrupt) are used by the serial module. vector_35 ( RTCC ) is used by the real time clock module.
All the test have been made with a PIC32-PINGUINO-OTG board and Linux IDE.

Sunday, December 4, 2011

KIDULES

Arduino’s idea is to hide the processor and complex C features, working with pins and libraries. Pinguino do the same, but it is also a powerful pedagogical tool to learn embedded systems and C. The Kidules follow this objective, and associate to the learning steps dedicated hardware that allows to concentrate on the software. Once the C and hardware features of the processor are mastered, any application with any C compiler can be envisioned, part of the application being initially tested on the Kidules.

The Ki18F2550 board features two 8-bit ports on which application and test circuits are connected. Each slave module has a simple and clear functionality:
- the Dice with 7 leds and a push-button helps with the understanding of bits and bytes. Using tables and byte access replace the writing of pages of digitalWrite (..); instructions.
- the Traffic light is good to think about specifications, before its easy programming.
- the Elevator has a motor and 3 sensors. It prepares for robots and exercises the notion of state machines
- the Clock helps understanding stepping motors. I2C clock circuit is an option.
Other Kidules allows to understand motors, sensors, internal PIC registers and their configuration. See www.didel.com/kidules/
The Kidules are specially suited for the first part of a Robotic or Embedded system lab.
The KiCar (not shown) is similar to the Ki2550, with ports for motors and sensors, ready to control a robot avoiding obstacles.
Documentation is mostly in French now. Ask to be updated : info@didel.com .

Friday, November 11, 2011

Increase speed on Pinguino32 !!

Default peripheral speed on Pinguino is programmed to 10 Mhz. For some application, we need to increase this speed ( 10 MIPS is less than a Pinguino 8 bits ). To achieve this, we must use the system library which is located in the /p32/include/pinguino/basics folder ).
The peripheral speed is derived from the system clock speed wich is 80 MHZ on Pinguino 32. You can select a peripheral speed with the SetPeripheralClock(divider) function. Divider should be chosen in the predefined value.
PBDIV8 use a 10 Mhz peripheral speed ( default value in Pinguino ).
PBDIV4 -> 20 Mhz
PBDIV2 -> 40 Mhz
PBDIV1 -> 80 Mhz

As an example, we propose this small program:

// increasing peripheral speed on Pinguino32
// Jean-Pierre Mandon 2011

void setup()
{
SetPeripheralClock(PBDIV1);
Serial.begin(9600);
}

void loop()
{
Serial.printf("System clock=%d\n\r",GetSystemClock());
Serial.printf("Peripheral clock=%d\n\r",GetPeripheralClock());
delay(500);
}

SetPeripheralClock must be the first instruction in the setup() because peripheral speed is used to configure Serial, delay and SPI.

Now your Pinguino32 is a real 32 bits/80 MIPS computer !!

Saturday, October 1, 2011

Open Silicium

Pinguino is described in the last issue of Open Silicium. This French paper speak about Open Hardware and Open Software.

Saturday, September 17, 2011

PinguBot

Pingubot is a small robot based on Pinguino 8 bits. Furri and Bastian designed this board to teach how to drive a robot with Pinguino.


The first PinguBot workshop will take place in the OSHWcon event in Madrid. Unfortunately, there is only 16 participant and registering is already closed.
We hope we will have soon another workshop somewhere in Spain.


Congratulations for this great initiative.

More info:
Pingubot website
OSHWcon website
Furri website

Tuesday, September 6, 2011

USB Female/Female A Adaptor


As usual, in the middle of the night, I was playing with my Android phone and Pinguino32. To connect them together, I was searching a USB female/female type A connector everywhere in my office. Finally I made this adaptor with a recycled connector found on an old mother board !!
The pin are soldered together on the bottom of the connector.

Saturday, September 3, 2011

Fractal with Pinguino

Marcus is one of the developers of Pinguino IDE. He focused on LCD and GLCD libraries.
He developed this example to show how to compute and display Fractal with Pinguino.



This is an example of a Mandelbrot set.
More info on Marcus's website.

Wednesday, August 31, 2011

Pinguino Robot !!

Julio is a teacher and he uses Pinguino to develop real robot with students.
This one is the last robot they built with recycled parts.



Congratulations to Julio and all the students working on this project.

Visit Julio's blog, it's a great source of information for Pinguino and electronic.

Friday, August 19, 2011

Pinguino Data logger

I discovered this great video today !! This Pinguino data logger built with a 8 bits Pinguino and Gambas is really nice....



Congratulations !!

Wednesday, August 17, 2011

Pinguino 32 with Android.

First test of Pinguino32 with Android is done. We incorporated in Pinguino32X the IOIO ADB library and everything is working fine. My son, Thomas presents here my first Android/Pinguino application ( as usual I drive Led !! )



As most of Android devices are not yet upgraded with Android 2.3.4, we decided to use ADB protocol wich is compatible with Android 1.6 and higher. As usual in Pinguino IDE, you need only 3 instructions to establish a link with an Android device. We are currently working on the release of the Pinguino IDE. It will incorporate Zigbee, ADB and our current job is to incorporate USB Host to connect mouse, keyboard and generally all useful USB devices.

I am very proud of my first Andoid application, even is this one is not optimised as it should be !!


Many thanks to the IOIO project and Ytai Ben-Tsvi, his owner. Most of the job shown here couldn't be done without the IOIO code.

Monday, August 1, 2011

One more time !! PinguinoVE

I like to hear about the Pinguino community.... And the Venezuelian community of Pinguino is still very active. PinguinoVE has been created at the beginning of this project, using Pinguino to teach home made digital electronic. All the guys working on this project are proud to see what Pinguino is used for and I like to present again this great team.


The last event where PinguinoVE was presented in Venezuela is the national congress of free software. During 3 months, in 11 cities, the PinguinoVE team insured presentation and workshop. More than 30 people for each workshop and 400 people for each presentation. The main question was 'What is Pinguino ?' and how can it be used to expand knowledge. The audience was composed of university students,teachers, geeks, government representatives.



And, as usual, Richard Stallman was there.


PinguinoVE website is the main place to see the work of this community.
More photos here.

Thanks Alexis, Jhuliana, Joan and all the team !!
We keep in touch.....

Friday, July 15, 2011

Maddog in Campus Party Valencia

Maddog was here yesterday to celebrate the commemoration of 20 years of Linux. Of course we were there and we took a photo to celebrate with him and all the Campuseros this birthday.

Campus Party Workshop

Hi Guys



Pinguino workshop is more and more active. We are working on communication with sensors with Pinguino32. Infra-red communication is OK, we can now transmit messages with an infra-red led and receive them with a TSOP module. We are going to share the code today on the blog.
Today is our last session, we prepared some code to connect Pinguino32 each other, with IR, Zigbee module and finally, the communication activity will be monitored through a Linksys router with OpenWRT. Benoit is working on a graphical application with processing to display the communication activity.



As usual, Boops is working hard, day and night..........

Thursday, July 14, 2011

Campus Party Valencia


As usual, Campus Party is a great event !!
After a quick presentation of Pinguino, we started a "network with sensors" workshop. The goal is to establish communication with sensors beetween PIC32-PINGUINO boards. Light, laser, zigbee, serial and interfacing with a WRT54GL for link with the net.
Fortunately, Boops is with us. He designed a shield for Pinguino 32 with 4 IR LED as transmitter and 2 IR Demodulator as receiver.

As Pinguino IDE is still an experimental version, the first day has been devoted to installation ( windows and Linux ). The second day, we started to test IR transmission and reception. Today, we will design our 'sensor network' and establish a common protocol.
Benoit is writing a processing application to monitor communication of modules.

Campus Party is a good way to speak about this project, exchange idea, share knowledge and more......
Now I must go to listen and Android application development conference. Yet another interesting subject for Pinguino !!

Sunday, June 12, 2011

PIC32-PINGUINO Power Supply

I want to build a Temperature sensor powered by a solar panel. I made some test to define the comsuption of Pinguino 32 in different configuration:

First configuration:
Pinguino 32 is powered by its power connector with a 9 Vdc power supply.

The current is about 80 mA on the power supply. Power input is 0,72 Watt.

Second configuration:
Pinguino 32 is powered by its LiPo charger connector ( as it could be with a battery ).



Now the current is about 90 mA. Power input is about 0,324 Watt.
All the tests were done with a clock frequency of 80 Mhz. Then I decided to swith the clock frequency to 40 Mhz and now the current is about 60 mA with 3,6V ( 0,216 Watts ).

Now, just have to find the good solar panel.........

Thursday, June 2, 2011

Yet another Pinguino robot

This robot is controlled with Pinguino. I like this design and it seems to work as Theo Jansen Robots.



Great work, this blog need a visit !!
You can find there a lot of ressources for Pinguino.

Temperature Sensor

I built this very simple temperature sensor with a DS18B20. It is connected on a PIC32-PINGUINO and powered from the data line.


The DS18B20 library is very simple to use, just one line to check the temperature on the sensor:

#define ONEWIREBUS 9 // define the pin connected to the 18B20+ Dline

void setup()
{
Serial.begin(9600);
pinMode(8,OUTPUT);
digitalWrite(8,HIGH); // pin 8 is used to power the 18B20 ( +Vcc )
pinMode(10,OUTPUT);
digitalWrite(10,LOW); // pin 10 is used to power the 18B20 ( GND )
}

void loop()
{
TEMPERATURE t;

if (DS18B20.read(ONEWIREBUS, SKIPROM, RES9BIT, &t))
{
if (t.sign) Serial.printf("-");
else Serial.printf("+");
Serial.printf("%d",t.integer);
Serial.printf(".%d",t.fraction);
Serial.printf("\n\r");
}
}


Now it's time to connect the DS18B20 and the zigbee shield to have a wireless temperature sensor !!


back view


Front view

ZIGBEE for PIC32

Pinguino32 uses a MRF24J40MA radio module to communicate with another Pinguino32 !!

This shield uses the UEXT connector of PIC32-PINGUINO and PIC32-PINGUINO-OTG. A very simple library is used to communicate with the module. You need only to initialise the module in the setup()

ZIG.init(channel,PAN_ID,Short_Address);

then to send data, you must use the ZIG.send instruction as described below:

ZIG.send(Dest_Address,"TOTO",4);

each module must be configured with:
- radio channel ( between 11 and 26 )
- PAN ID ( personnal area network identification between 0 and 65535 )
- address ( between 0 and 65535 ).

to receive data from another module, you must use this instruction:

length=ZIG.read(rxdata);

A simple example has been added to the example folder of revision 147 of Pinguino32X.


Have fun
JP

Thursday, May 26, 2011

Pinguino32X windows

Hi Guys

Now Pinguino32X is available for windows. We worked on a lot of improvement for this release. most of the extended functions for 8 bits systems are documented on the pinguino wiki ( wiki.pinguino.cc ). For 32 bits Pinguino, this first version support our Pinguino32 compiler built from GCC4.5.2 and newlib.

You can download Pinguino32X windows here.

For 32 bits boards, our 32 bits compiler can be downloaded here.

Most of the code already existing for 8 bit Pinguino can be used on 32 bits ( Serial, CDC, I/O, analog etc... ) with much more power of course ( Pinguino32 is a 80 MIPS machine !! ).

We are waiting your opinion on this new release.

Have fun
JP

Monday, May 9, 2011

SOLUTIONS LINUX/PINGUINO32X

Hi Guys,

The last 3 month were dedicated to Pinguino32X development. It's time now to publish the first version of the IDE. What is new in this release ? I didn't write a complete list and we still need to define all the changes. For 8 bits boards, Pinguino is now almost compatible with Arduino language, most of the new features are already detailed in the pinguino wiki ( http://wiki.pinguino.cc ).
The major improvement of this release is the support of 32 bits board. You can now use Pinguino on a 80MIPS system. The compiler for this release is available in a separate package. Built from GCC 4.5.2, it is a standard MIPS C compiler. The development team is already working on the C++ version of this compiler with newlib libraries.
Support for some commercial 32 bits board is available:
- PIC32-PINGUINO from OLIMEX
- EMPEROR460 and EMPEROR795 from EDTP

This board should be available soon, the end user price is around 30€.

I will be in Paris tomorrow at Solution Linux event to show the new board and his development environment. I will present this board on the FEDORA stand, the good news is that Pinguino should be incorporated in a next release of the FEDORA EL package ( EL is Electronic ) and I'm very pleased to publish the new version for this event.

At this moment, Pinguino32X is only available for Linux:
download the new IDE here:
http://code.google.com/p/pinguino32/downloads/list
download the Pinguino 32 bits compiler here:
http://www.hackinglab.org/pinguino/download/compiler32bits/
Follow this link to configure the IDE for 32 bits board:
http://code.google.com/p/pinguino32/wiki/Pinguino32Xconfigurationandinstallation

Have fun
Jean-Pierre

Main developpers of Pinguino32X:
Regis Blanchot
Marcus Fazzi
Jesus Carmona Esteban

Wednesday, February 23, 2011

PIC32-PINGUINO is here !!

Hi guys,

I just received the new Pinguino 32 bits board !! This board will be the main support board for Pinguino32X development.... Designed and Built by OLIMEX for the Pinguino community. It have a lot of interesting possibilities:
- PIC 32MX440F256H at 80 Mhz,
- RTC already on board ( crystal + capacitor ),
- LIPO charger,
- wide power supply ( 9-30 VDC ),
- noise free,
- UEXT connector,
- shield compatible......
And a lot of other great features..

We are working hard to publish the next release of Pinguino IDE soon.
The Changelog is now a book !!
A team is working on 8 bits improvements, another on 32 bits boards and GCC. The powerful of this 32 bits system should be soon available as easy as development is for 8 bits systems.
Thanks again to all the contributors, developers, users.

JP

Wednesday, February 16, 2011

Pinguino/Processing from Thailand !!

Niti from Thailand send us this video to show use of Pinguino with Processing.
We could hope Niti will publish the code to help Processing users to incorporate Pinguino in their application.

Driving a 7 segment display



More poetic with an RGB led !!



Thanks for this great application Niti...

Pinguino32X minimum board

Hi,

Marcus build his own Pinguino 32 bits board with a 32MX795F512L

We are working hard to release the Pinguino IDE with support of 32 bits. It will be a mini board with maxi power !!
We should have good news for you soon :-)

More info on Marcus website

Saturday, January 29, 2011

Pinguino in the Microchip's Academic Program Newsletter


Pinguino is presented in the last Microchip Academic Program Newsletter. Yet another way to support this project for Microchip.
You can download the letter on the Microchip website.

Have fun
JP

Tuesday, January 11, 2011

Python Pinguino object

A Pinguino object for processing was developped by Stephane Cousot. Now a similar object exist with Python !!
Yeison Cardona wrote this object to use Pinguino with Python without knowledge of C programming. The pinguino side software use CDC to communicate with the computer. The computer use python to drive outputs, read analog inputs and many other things.

It is very simple to use, this is a simple example to blink 2 leds:

from pynguino import PinguinoProcessing
import time

pinguino
=PinguinoProcessing()
print pinguino.Conect('/dev/ttyACM0') # Choose the port for Pinguino

led1
=1
led2
=7
tempo
=0.2
while True:
time
.sleep(tempo)
pinguino
.digitalWrite(led1,"high")
pinguino
.digitalWrite(led2,"low")
time
.sleep(tempo)
pinguino
.digitalWrite(led1,"low")
pinguino
.digitalWrite(led2,"high")
More info on the project website:
http://code.google.com/p/pinno-processing/

Sunday, January 2, 2011

Happy new year 2011 !!

Hi Guys,

2010 was a very good year for Pinguino and it's a pleasure to see how this project evolve. I remember the first version, it is not so far, and I am pleased to see that the beta 9-05, even if it is not perfect, is a working version and help to build many different things. This job was done with many contributions, reports and ideas. Each user, in its own way, is a contributor and help to make this tool more friendly and powerful.
I announced, a long time ago, Pinguino could be ported to 32 bits Microchip micro-controller, and now it's done. This feature don't stop the 8 bits development, but it's a new major improvement for this platform. I think 2011 should be again a good year for Pinguino.
Many thanks to you, guys.
I wish you a fantastic year, keep cool and stay connected with us.....
And if you are a new user, Welcome !!

PinguinoX Preview