probleme du prog en C
Répondre à la discussion
Affichage des résultats 1 à 3 sur 3

probleme du prog en C



  1. #1
    invitef4a86cda

    probleme du prog en C


    ------

    bonjour,
    voilà un programme que j'ai trouvé pour écrire dans l'EEPROM, le probleme c'est qu'il est censé copier un tableau de 16 cases la RAM dans l'EEPROM, mais il ne recopie que la première case qui a comme valeur AAAA
    pouvez vs m'aider à trouvé la faute commise dans le programme ?


    #include "../../EEPROM.X/h/DataEEPROM.h"
    #include "../../EEPROM.X/h/p30F4011.h"



    _FOSC(CSW_FSCM_OFF & XT_PLL8); /* Set up for XTxPLL8 mode since */
    /* we will be tuning the FRC in this example */

    _FWDT(WDT_OFF); /* Turn off the Watch-Dog Timer. */
    _FBORPOR(MCLR_EN & PWRT_OFF); /* Enable MCLR reset pin and turn off the power-up timers. */
    _FGS(CODE_PROT_OFF); /* Disable Code Protection */

    /*Declare constants/coefficients/calibration data to be stored in DataEEPROM*/
    int _EEDATA(32) fooArrayInDataEE[] = {0,1,2,3,4,5,6,7,8,9,0xA,0xB,0 xC,0xD,0xE,0xF};

    /*Declare variables to be stored in RAM*/
    int fooArray1inRAM[] = {0xAAAA, 0xBBBB, 0xCCCC, 0xDDDD, 0xEEEE, 0xFFFF, 0xABCD, 0xBCDE, 0xCDEF, 0xDEFA, 0x0000, 0x1111, 0x2222, 0x3333, 0x4444, 0x5555};

    int fooArray2inRAM[16];

    int main(void);
    void _ISR _DefaultInterrupt(void);


    int main(void)
    {
    int temp = 0;

    /*Read array named "fooArrayinDataEE" from DataEEPROM and place the result into*/
    /*array in RAM named, "fooArray2inRAM" */

    temp = ReadEE(__builtin_tblpage(&fooA rrayInDataEE[0]),__builtin_tbloffset(&fooArra yInDataEE[0]),&fooArray2inRAM[0], ROW);

    /*Erase 16 words (1 row in dsPIC30F DataEEPROM) in Data EEPROM from array named "fooArrayinDataEE" */
    temp = EraseEE(__builtin_tblpage(&foo ArrayInDataEE[0]), __builtin_tbloffset(&fooArrayI nDataEE[0]), ROW);

    /*Write 16 words (1 row in dsPIC30F DataEEPROM) to Data EEPROM from array named "fooArray1inRAM" */
    /*to array named "fooArrayinDataEE" */

    temp = WriteEE(&fooArray1inRAM[0],__builtin_tblpage(&fooArrayIn DataEE[0]),__builtin_tbloffset(&fooArra yInDataEE[0]), ROW);


    while(1);/* Place a breakpoint here, run code and refresh the DataEEPROM window in MPLAB IDE */
    }


    void __attribute__((interrupt, no_auto_psv)) _DefaultInterrupt(void)
    {
    while(1) ClrWdt()
    }

    Merci

    -----

  2. #2
    Jack
    Modérateur

    Re : probleme du prog en C

    Il serait bon de lire nos règles participatives en info. Piqure de rappel:
    http://forums.futura-sciences.com/programmation-langages-algorithmique/441632-regles-participatives-nouveau-forum.html

    Déplacement en électronique

  3. #3
    DAUDET78

    Re : probleme du prog en C

    utilise les balises [/CODE] et [CODE] pour le code .... et laisse le vert aux modos ..... c'est illisible !
    Dernière modification par DAUDET78 ; 26/04/2012 à 16h34.
    J'aime pas le Grec

Discussions similaires

  1. Probleme prog Servomoteurs
    Par inviteecadf7bc dans le forum Électronique
    Réponses: 3
    Dernier message: 19/03/2011, 17h35
  2. probleme avec ce prog
    Par invite2d201af9 dans le forum Logiciel - Software - Open Source
    Réponses: 1
    Dernier message: 16/09/2009, 12h25
  3. Problème avec IC-PROG
    Par invitea4531517 dans le forum Logiciel - Software - Open Source
    Réponses: 1
    Dernier message: 24/07/2009, 13h01
  4. Problème avec IC prog
    Par domi76360 dans le forum Logiciel - Software - Open Source
    Réponses: 1
    Dernier message: 11/07/2007, 08h50
  5. Problème prog. PIC
    Par invite9013ee57 dans le forum Électronique
    Réponses: 2
    Dernier message: 22/01/2007, 12h29
Découvrez nos comparatifs produits sur l'informatique et les technologies.