Mostrando postagens com marcador pic. Mostrar todas as postagens
Mostrando postagens com marcador pic. Mostrar todas as postagens

2011-03-16

Pinguino32X minimum - REV4

Pinguino32X minimum REV4 - IO PIN Mapping
- I made a mistake on PROG/USER buttons positions, swapped
- Added PWM pins
- Added voltage pin legend

2011-02-21

Pinguino32X minimum - REV2

During port of LCDlib to Pinguino32X, I detected a noise on 3.3V Regulator, adding two capacitors between Vout (3.3V) and GND, solved it.

Here the new schematic:

2011-02-16

Pinguino32X minimum - rev.4 updated

Pinguino32X is the newest project on port and run code from Arduino boards using Microchip PIC micro-controllers:
Using a PIC32MX4xx/5xx/6xx/7xx  we have:
- 80 MHz power! (default on Pinguino 32X)
- 78 IO Pins (Arduino PIN 0 is PIC32 RC4 pin, see UBW32 pin order, look on eagle schematic)
- 16 Channels, 10bit ADC
- USB, DMA, OTG, CAN, LAN, RTC, SPI, i2c and more ...

First all, we need some vital pieces:
1- PIC32MX795F512L or a PIC32MX460F512L from Microchip, you can take 3 samples at Microchip.com, SAMPLES
PIC32

2- A TQFP 100pins 0.4mm, U$1,50 at Futurlec, SMD_Adapters
TQFP Adapter 100pins/0.4mm

3- Some common electronics:
Type Value QTD
Capacitor
22 pF
2
Capacitor
100 nF
6
Capacitor
10 µF
2
Capacitor
1 µF
1
Resistor
10 KΩ
3
Resistor
330 Ω
5
LED
-
5
Crystal
8MHz
1
Switch Button
-
3
Regulator
KIA78R33 (3.3V)
1

4- And a Breadboard!

Next we need do the hard work, solder the chip, yeah a SMD 100pins 0.4mm, less then a half millimeter. Thanks a friend, he soldered to me it...
PIC32MX795 soldered

I made a schematic with Pinguino PINs 0 to 78, using UBW32 pin order.

Pinguino32 minimum circuit

Here my Board:
Pinguino32X minimum

Files:
UBW32 Firmware:
UBW32_HIDBoot_MX795.hex
UBW32_HIDBoot_MX460.hex

Atention:
1- You need a pickit3 or similar to program PIC32MX795, I used MPLAB-X (blogged)

2- You can use a pickit2 for PIC32MX460 (last supported PIC32), pk2cmd works very well.

3- We need powerup PIC32 or can't program it, for a UBW32 board use the USB cable.

If you have a PIC32MX460, this is the command line for program it, using ICSP port:
linux>$ pk2cmd -P -W -M -F UBW32_HIDBoot_MX460.hex

A simple code like blink a LED can be used with this Pinguino32X minimum and Pinguino32X IDE, for now IDE is under development but all 78 Digital IOs are working.

2011-02-05

MPLAB-X, finalmente a Microchip Multiplataforma!


A Microchip está desenvolvendo o MPLAB-X, que provavelmente irá substituir nosso velho conhecido MPLAB. O MPLAB-X já está na Beta 4, contudo só tem suporte às gravadoras mais recentes como a PicKit3 e a ICD3, no forum da Microchip os desenvolvedores já se pronunciaram e teremos suporte à pickit 2 em breve...

A seguir algumas características do MPLAB-X
1- O X não é a toa, o MPLAB-X roda em Linux, Windows e Mac OS;
2- A IDE é uma versão customizada do Netbeans, assim temos autocomplementação de código e outras funcionalidade inerentes ao Netbeans.


MPLAB X IDE Features Supported
Features Supported
Features Supported
Flash Memory view
Hex file generation
Data Memory view
Upload Silicon image
SFR/Peripheral view
Memory Usage
Core registers
Resource Usage
Watch window
Freeze Peripherals
Locals view
Library projects (Ex Hi-Tech)
EEPROM view
Logging for diagnosis
Basic Debug
Zip Projects
Software Breakpoints
Checksum
Simple/Advanced Breakpoints
Software Call Stack (compilers that support it)
Drag n Drop to watch window
Status bar information
Pre-Built (Hex) projects (import hex)
Simulators CORE only
Compiling
Build Options for individual files
Create/Open new Project
Export hex
Call Graph
Device Debug Headers for REAL ICE, ICD3 and PICkit3
Import Legacy projects
Disassembly for Debugging
Auto discovery of compilers
Multiple hex files bootloader/application model
Generic header files in pre-parser
Stop Watch support
Run production image
Import data to memory views
Program Production image
Multiple Configurations
Reset at Main()
Free RTOS viewer
Animate
DMCI with static array plots

MPLAB X IDE Features Unsupported
Known Unsupported Features
Known Unsupported Features
Shadow registers
Tool status
Hardware Call Stack
Simulator Peripherals
Watch color on changed values
No Run time watch or Data Capture
Auto-install of compilers
PICC18 Standard
Auto driver switching for tools
Multiple debug sessions
No Debug headers for ICD2
No Trace of any sort
64 bit JVM and XP64 drivers on Windows OS
Pre-post build steps from GUI (available throughmakefiles)
No MPASM on Mac
Many RTOS viewers
Limited ASM syntax and editor support features
no/cond :- This needs a new version of MPASM assembler
Full DMCI live update support
PIC18FJ46J50, PIC18FJ67J50 and memory starter kits 
PICkit 3 Programmer to Go
Code Coverage
Filter Trace
Code Guard support
Debug Read for refresh and no reset
Open Source Community Plugins
Linux 64 bit support
16 bit instructions on the PIC32 Simulator


Download:
http://ww1.microchip.com/downloads/mplab/X_Beta/index.html

O que posso dizer, MPLAB finalmente com supporte ao Linux!

2010-11-11

Apresentação Arduino/Pinguino (Presentation)

Hoje farei duas palestras aos colegas também alunos do IESAM, aonde estou fazendo Engenharia da Computação, sobre as placas desenvolvimento arduino, no link abaixo a palestra em PDF.




Conheca_o_arduino.pdf

2010-11-10

Pinguino 32X no forno!

Galera já estamos a desenvolver a versão Pinguino com o PIC32MX460F512L e PIC32MX795F512L.

O compilador C já está funcional, estamos aguardando a Microchip liberar as licenças para uso de algumas bibliotecas deles com o projeto Pinguino que é Software Livre.

Já temos uns testes de UART e Blink a LED.

A Placa a ser usada é a UBW32 http://www.schmalzhaus.com/UBW32/

2010-08-27

Pinguino GLCD Library, files, examples and doc!

Eis finalmente a biblioteca GLCD para Pinguino!
http://vivaphp.net/pinguino/glcd/GLCD_pinguino_library.zip

Esta versão sairá junto com a IDE Pinguino 9.02 beta!

Jp.Mandon, me antecipou os novos recursos na beta 9.02
  1. GLCD library;
  2. A fix of the delay routines;
  3. Maybe the complete translation for all available language.
  4. Self replicating (modo Gravadora PIC)
Pinguinos criando pinguinos!

2010-08-14

Biblioteca LCD Pinguino!

Finalmente consegui, migrar o código wiring do pinguino para SDCC e transformei em uma biblioteca .c/.h. A biblioteca é composta de dois arquivos lcdta de dois arquivos lcdlib.c e lcdlib.h, também modifiquei o exemplo do post anterior (Pinguino Clock com a mini animação do jogo pong)


Apenas uma pequena explicação de como transformar um arquivo .pde em uma biblioteca pinguino:
  1. Compile o arquivo .pde da sua biblioteca.
  2. Edite o arquivo source/user.c
  3. Crie sua biblioteca com base neste arquivo.

Como usar a biblioteca:
  1. Lembre-se que digitalwrite, e os comandos de delay do arduino não fazem parte do pacote SDCC, e que o pinguino não os adiciona as includes para esses, ou os adicionará ao final do arquivo tmp/define.h o que gerará erros de compilação na IDE Pinguino/SDCC.

Assim  temos um problema de ordenação das includes que não pode ser resolvido somente via biblioteca, para resolver isso temos de fazer os includes que a IDE pinguino faria, manualmente, como no trecho de código abaixo (código completo no zip acima):

// Remove line above if you using a pinguino with PIC18F2550, need this define before include digitalw.c

#define PIC18F4550
#include <stdlib.h>
//Include libraries used on you user lib, before include that, pinguino IDE works well on it.

#include <delay.h>

#include <arduinodelay.c>

#include <digitalw.c>
//LCD library

#include <lcdlib.c>

Reparem que a minha nova biblioteca, compatível com os códigos arduino em 99%, só é chamada após carregarmos as bibliotecas necessárias, caso deixássemos por conta da IDE, esta include viria na frente das outras no arquivo define.h

OBS: Esta versão só funciona com a Pinguino IDE beta8 ou maior. Outra versão será lançada junto com a IDE beta9

Gerador de caracteres para LCD/Pinguino

Ontem estava trabalhando na parte final do projeto da biblioteca LCD para pinguino, e deparei com a tarefa de criar caracteres do usuário, bom a tarefa apesar de simples é um pouco tediosa e resolvi automatizar o processo.

Assim nasceu o Easy LCD CGRAM, desenvolvi em Java usando o NetBeans, não é a melhor opção mas tenho de estudar Java para a faculdade... :-(

A ideia é  simples, são 64 botões que representam os pixels do display LCD, você clica nestes e depois gera o código para uso com a biblioteca pinguino que postei antes, o processo todo é muito fácil.

Screenshot:
Fontes e programa:
easy_LCD_CGRAM.zip

Como usar?
Basta colocar o código dos caracteres após o comando begin(), no setup{...}, e usa-los no loop{...} com o comando write():
Apenas, lembrem-se de usar o restante do código .pde e arquivo .h do post anterior...
/*
  *************************************************************************
 ***************************************************************************
**                LCD pratical use! PINGUINO CLOCK!                        **
 ***************************************************************************
  *************************************************************************
 */
// Remove line above if you using a pinguino with PIC18F2550
#define PIC18F4550

#define HOUR 20
#define MIN 19

//global vars
uchar counter = 0;
uchar sec  = 0;
uchar min  = 0;
uchar hour = 0;

uchar num = 0;
 
void setup(){
    //8 bits mode
    //lcd(8, 9, 0, 1, 2, 3, 4, 5, 6, 7); // RS, E, D0 ~ D7
   
    //4 bits mode, dont use last four pins ...
    lcd(8, 9, 4, 5, 6, 7, 0, 0, 0, 0); // RS, E, D4 ~ D8    
   
    //LCD format
    begin(2, 0);
   
    //Creating user chars
    //Set AC register to initial CGRAM position
    command(0x40);
    //Write character code
    write(0x3);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x8);
    write(0x18);
    //Write character code
    write(0x6);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x4);
    write(0x0);
    write(0xc);
    //Write character code
    write(0x6);
    write(0x0);
    write(0x0);
    write(0x2);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0xc);
    //Write character code
    write(0xc);
    write(0x0);
    write(0x1);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x6);
    //Write character code
    write(0x6);
    write(0x2);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x3);
    //Write character code
    write(0xc);
    write(0x0);
    write(0x4);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x6);
    //Write character code
    write(0x6);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x8);
    write(0x0);
    write(0x0);
    write(0xc);
    //Write character code
    write(0x3);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x0);
    write(0x10);
    write(0x0);
    write(0x18);

    /* Debug */
    pinMode(13, OUTPUT);        // LED on pin 12
   
    //Setup buttons
    pinMode(20, INPUT);
    pinMode(19, INPUT);
}
 
void loop()
{
    // Output string
    home();
    lcdPrint("Pinguino Clock!");    // Output char
   
    setCursor(15, 1);
    //Using user chars, a very small pong game! :P
    if(counter % 2){
        num++;
        if(num > 8){
            num = 0;
        }
        write(num);
    }
   
    if (counter>9){
        counter = 0;
        sec++;
    }
   
    if (sec>59){
        sec = 0;
        min++;
    }
   
    if (min>59){
        min = 0;
        hour++;
    }
   
    if (hour>23){
        hour = 0;
    }
   
   
    setCursor(0, 1);
    if (hour < 10)
        lcdPrint("0");    
    printNumber(hour, 10);
   
    if (min < 10)
        lcdPrint(":0");
    else
        lcdPrint(":");        
    printNumber(min, 10);
   
    if (sec < 10)
        lcdPrint(":0");
    else
        lcdPrint(":");
    printNumber(sec, 10);    
   
    //set hour and min    
    if(digitalRead(HOUR) == LOW){
        hour++;
    }
    if(digitalRead(MIN) == LOW){
        min++;
    }
   
    counter++;
    delay(52); //Need two delays by 52ms, crystal/clock/PIC18F code? DSO give me 100.1ms with this!
    digitalWrite(13, LOW);
    delay(52);
    digitalWrite(13, HIGH);    
}