PIC32 et EXPLORER 16
Répondre à la discussion
Affichage des résultats 1 à 5 sur 5

PIC32 et EXPLORER 16



  1. #1
    invitea2c70312

    PIC32 et EXPLORER 16


    ------

    Bonjour,

    J’ai en ma possession un PIC32MX460F512L et d’un carte Explorer 16 de microchip.

    J’ai téléchargé les programmes de microchip pour cette carte avec le PIC 24
    J’ai tenté de les reprendre et de les adapter a mon PIC32 mais en vain !
    Et dans le programme il y a des "Nop".. et il me fait des erreurs avec les nop....

    Vous ne pourriez pas m’aider pour la programmation du LCD, pour que je puisse afficher un texte ?

    Je laisse ci joint les programmes du PIC24 pour le LCD.
    Code:
    #include "p24HJ256GP610.h"
    #include "lcd.h"
    #include "delay.h"
    
    
    /*  
       For Explorer 16 board, here are the data and control signal definitions 
       RS -> RB15 
       E  -> RD4 
       RW -> RD5 
       DATA -> RE0 - RE7    
    */
    
    // Control signal data pins  
    #define  RW  LATDbits.LATD5       // LCD R/W signal 
    #define  RS  LATBbits.LATB15      // LCD RS signal 
    #define  E   LATDbits.LATD4       // LCD E signal  
    //#define  E   LATFbits.LATF1       // LCD E signal 
    
    // Control signal pin direction  
    #define  RW_TRIS TRISDbits.TRISD5
    #define  RS_TRIS TRISBbits.TRISB15
    #define  E_TRIS  TRISDbits.TRISD4
    //#define  E_TRIS  TRISFbits.TRISF1 
    
    // Data signals and pin direction 
    #define  DATA      LATE           // Port for LCD data 
    #define  DATAPORT  PORTE
    #define  TRISDATA  TRISE          // I/O setup for data Port 
    
    
    
    /****************************************************************************/
    /***** LCD SUBROUTINE  *****/
    
    void Init_LCD( void )             // initialize LCD display 
    {
    // 15mS delay after Vdd reaches nnVdc before proceeding with LCD initialization 
    // not always required and is based on system Vdd rise rate 
    Delay(Delay_15mS_Cnt);                  // 15ms delay 
    
    /* set initial states for the data and control pins */
    LATE &= 0xFF00;
        RW = 0;                       // R/W state set low 
    RS = 0;                       // RS state set low 
    E = 0;                        // E state set low 
    
    /* set data and control pins to outputs */
    TRISE &= 0xFF00;
     RW_TRIS = 0;                  // RW pin set as output 
    RS_TRIS = 0;                  // RS pin set as output 
    E_TRIS = 0;                   // E pin set as output 
    
    /* 1st LCD initialization sequence */
    DATA &= 0xFF00;
        DATA |= 0x0038;
        E = 1;
        Nop();
        Nop();
        Nop();
        E = 0;                        // toggle E signal 
        Delay(Delay_5mS_Cnt);         // 5ms delay 
         
    /* 2nd LCD initialization sequence */
    DATA &= 0xFF00;
        DATA |= 0x0038;
        E = 1;
        Nop();
        Nop();
        Nop();
        E = 0;                        // toggle E signal 
        Delay_Us( Delay200uS_count ); // 200uS delay 
    
    /* 3rd LCD initialization sequence */
    DATA &= 0xFF00;
        DATA |= 0x0038;
        E = 1;
        Nop();
        Nop();
        Nop();
        E = 0;                        // toggle E signal 
        Delay_Us( Delay200uS_count ); // 200uS delay 
    
        lcd_cmd( 0x38 );              // function set 
        lcd_cmd( 0x0C );              // Display on/off control, cursor blink off (0x0C) 
        lcd_cmd( 0x06 );     // entry mode set (0x06) 
    }
    
    
    void lcd_cmd( char cmd )          // subroutiune for lcd commands 
    {
    // TRISD &= 0xFF00;              // ensure RD0 - RD7 are outputs 
    DATA &= 0xFF00;               // prepare RD0 - RD7 
        DATA |= cmd;                  // command byte to lcd 
    RW = 0;                       // ensure RW is 0 
        RS = 0;
        E = 1;                        // toggle E line 
        Nop();
        Nop();
        Nop();
        E = 0;
        Delay(Delay_5mS_Cnt);         // 5ms delay 
    }
    
    
    void lcd_data( char data )        // subroutine for lcd data 
    {
    // TRISD &= 0xFF00;              // ensure RD0 - RD7 are outputs 
    RW = 0;            // ensure RW is 0 
        RS = 1;                       // assert register select to 1 
    DATA &= 0xFF00;               // prepare RD0 - RD7 
        DATA |= data;                 // data byte to lcd 
        E = 1;
     Nop();
        Nop();
        Nop();
        E = 0;                       // toggle E signal 
        RS = 0;                      // negate register select to 0 
        Delay_Us( Delay200uS_count ); // 200uS delay 
        Delay_Us( Delay200uS_count ); // 200uS delay 
    }
    
    
    void puts_lcd( unsigned char *data, unsigned char count )
    {
       while ( count )
    {
     lcd_data( *data++ );
     count --;
    }
    }
    lcd.h

    Code:
    /****** LCD FUNCTION PROTOYPES ******/
    
    void Init_LCD( void );          // initialize display   
    void lcd_cmd( char cmd );         // write command to lcd 
    void lcd_data( char data );      // write data to lcd 
    void puts_lcd ( unsigned char *data, unsigned char count );
    
    
    /***** LCD COMMAND FUCNTION PROTOTYPES  *****/
    #define cursor_right()  lcd_cmd( 0x14 )
    #define cursor_left()   lcd_cmd( 0x10 )
    #define display_shift() lcd_cmd( 0x1C )
    #define home_clr()      lcd_cmd( 0x01 )
    #define home_it()       lcd_cmd( 0x02 )
    #define line_2()        lcd_cmd( 0xC0 ) // (0xC0)
    et le delay.h

    Code:
    //#define Fcy  14754600 
    #define Fcy  16000000
    
    void Delay( unsigned int delay_count );
    void Delay_Us( unsigned int delayUs_count );
    
    #define Delay200uS_count  (Fcy * 0.0002) / 1080
    #define Delay_1mS_Cnt   (Fcy * 0.001) / 2950
    #define Delay_2mS_Cnt   (Fcy * 0.002) / 2950
    #define Delay_5mS_Cnt   (Fcy * 0.005) / 2950
    #define Delay_15mS_Cnt    (Fcy * 0.015) / 2950
    #define Delay_1S_Cnt   (Fcy * 1) / 2950

    merci

    -----

  2. #2
    RISC

    Re : PIC32 et EXPLORER 16

    Salut,

    Il existe des exemples tous faits sur internet pour te permettre de démarrer :

    Le RTOS gratuit FreeRTOS a été porté sur ta configuration :
    http://www.freertos.org/port_PIC32_MIPS_MK4.html

    Regarde aussi ici : http://www.micrium.com/microchip/index.html

    Ici une collection de liens superbe sur les PIC32, surtout si tu connais le russe ;=) : http://pic32.narod.ru/

    N'hésites pas à demander sur le forum dédié au PIC32. Je pense que pas mal de membres peuvent te donner du code pour démarrer : http://forum.microchip.com/tt.aspx?forumid=203

    Je viens de commander sur Amazon le premier bouquin sur les PIC32 : http://exploringpic32.com/

    a+
    Dernière modification par RISC ; 09/05/2008 à 15h08. Motif: correction

  3. #3
    invitea2c70312

    Re : PIC32 et EXPLORER 16

    Merci pour t'es info... mais sur le site de FREERTOS il n'y a pas des codes sources?.. car sinon jlé trouve pas... :s

    Si quel'qu'un a un programme qui fonctionne pour le LCD sur PIC 32 pensez a moi

    Merci!

  4. #4
    invitea2c70312

    Re : PIC32 et EXPLORER 16

    Edit : j'ai reussi a telecharger les code freeRtos...

    en compilant ca m'affiche ca :
    C:\Program Files\Microchip\MPLAB C32\bin\..\lib\gcc\pic32mx\3.4 .4\..\..\..\..\pic32mx\bin\ld. exe: address 0x9d086f70 of RTOSDemo.elf section .text is not within region kseg0_program_mem

    C:\Program Files\Microchip\MPLAB C32\bin\..\lib\gcc\pic32mx\3.4 .4\..\..\..\..\pic32mx\bin\ld. exe: section .rodata [9d000000 -> 9d000357] overlaps section .text [9d000000 -> 9d086f6f] Hint:You may have exceeded the code size limit for this edition

    C:\Program Files\Microchip\MPLAB C32\bin\..\lib\gcc\pic32mx\3.4 .4\..\..\..\..\pic32mx\bin\ld. exe: section .data [9d0003a8 -> 9d00049b] overlaps section .text [9d000000 -> 9d086f6f] Hint:You may have exceeded the code size limit for this edition

    C:\Program Files\Microchip\MPLAB C32\bin\..\lib\gcc\pic32mx\3.4 .4\..\..\..\..\pic32mx\bin\ld. exe: section .sdata [9d00049c -> 9d0004a7] overlaps section .text [9d000000 -> 9d086f6f] Hint:You may have exceeded the code size limit for this edition

    C:\Program Files\Microchip\MPLAB C32\bin\..\lib\gcc\pic32mx\3.4 .4\..\..\..\..\pic32mx\bin\ld. exe: section .eh_frame [9d000358 -> 9d0003a7] overlaps section .text [9d000000 -> 9d086f6f] Hint:You may have exceeded the code size limit for this edition

    C:\Program Files\Microchip\MPLAB C32\bin\..\lib\gcc\pic32mx\3.4 .4\..\..\..\..\pic32mx\bin\ld. exe: section .FreeRTOS [9d0004a8 -> 9d0008fb] overlaps section .text [9d000000 -> 9d086f6f] Hint:You may have exceeded the code size limit for this edition

    C:\Program Files\Microchip\MPLAB C32\bin\..\lib\gcc\pic32mx\3.4 .4\..\..\..\..\pic32mx\bin\ld. exe: RTOSDemo.elf: section .text lma 0x9d000000 overlaps previous sections

    C:\Program Files\Microchip\MPLAB C32\bin\..\lib\gcc\pic32mx\3.4 .4\..\..\..\..\pic32mx\bin\ld. exe: RTOSDemo.elf: section .eh_frame lma 0x9d000358 overlaps previous sections

    This appears to be a limited version of the C32 compiler. (Consider this when interpreting error messages.) Link step failed.
    J'utilise un C32 gratuit... le programme est trop volumineux?

  5. A voir en vidéo sur Futura
  6. #5
    invite01b8868e

    Re : PIC32 et EXPLORER 16

    bonjour danidof,
    est ce que tu as trouvé la solution pour LCD ,
    svp donner moi la solution ,je travaille avec C32;
    MERCI

Discussions similaires

  1. Internet Explorer 7
    Par invite6de5f0ac dans le forum Logiciel - Software - Open Source
    Réponses: 14
    Dernier message: 12/11/2006, 11h51
  2. internet explorer
    Par haddadou dans le forum Internet - Réseau - Sécurité générale
    Réponses: 8
    Dernier message: 22/10/2006, 19h14
  3. Internet Explorer
    Par cedbont dans le forum Internet - Réseau - Sécurité générale
    Réponses: 11
    Dernier message: 07/02/2005, 21h37
  4. explorer.exe
    Par invitee8808f55 dans le forum Internet - Réseau - Sécurité générale
    Réponses: 2
    Dernier message: 29/10/2004, 00h02
  5. Internet Explorer 6
    Par pjlt dans le forum Internet - Réseau - Sécurité générale
    Réponses: 10
    Dernier message: 10/04/2004, 17h40
Découvrez nos comparatifs produits sur l'informatique et les technologies.