News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Anomaly found when using SPI_24.INC

Started by Gamboa, Mar 30, 2022, 09:16 AM

Previous topic - Next topic

Gamboa

Hi Les,

OS: Win10 Pro 64bits
Positron Compiler 1.1.0.8
SPI_24.INC (file with version 1.0.6.7)
Microcontroller: PIC24FJ64GA306

In January 2020 I used the SPI_24.INC library to access a 25LC256 memory with the Proton24 ver 1.0.6.7. Everything correct, writing and reading OK.

Now I have had to make a modification to the program and when recompiling the application I have used Positron24 ver 1.1.0.8. The compilation is successful but the application fails to read the EEPROM through the SPI routine. I don't know if the write fails.

I have compiled the same source code with both versions and with Positron24 version ver 1.1.0.8  Memory reading fails. The verification of both versions has been verified with the same hardware.
I attach the used SPI_24.INC library. It is the library that came with the compiler in version 1.0.6.7 of Proton24.

The reading routine used is the following:
SYMBOL READ_25LC256   %00000011
DireccionMemoria = 32764
 

  PROC LeerNumeroSerie()

    '1.- Envío la instrución de lectura + dirección + dato a leer
    CS_Pin = 0 'Selecciono la memoria
    SPI_Write(READ_25LC256)            'Envío el comando de lectura
    SPI_Write(DireccionMemoria.BYTE1)  ' \ Envío la direccion de 16 bits (MSB primero)
    SPI_Write(DireccionMemoria.BYTE0)  ' /

    FOR i=0 TO 3    'Leo los 4 bytes del numero de serie
      BuferListaBlanca[i] = SPI_Read()
    NEXT i

    CS_Pin = 1 'Deselecciono la memoria

   ENDPROC


I don't know how to proceed further clarifying the issue.

Any help will be appreciated. Thank you.

Regards,
Gamboa





Long live for you