Menu

write read 16f526 eeprom

Help
Orlando D.
2017-10-11
2017-10-11
  • Orlando D.

    Orlando D. - 2017-10-11

    I'm facing a problem with pic16f526 reading and writing eeprom .
    HEX compiler return me a error

    GCASM: Symbol RP0 has not been defined.

    Searching in similar pic (16f684) data sheet i find that RP0 register is used for addressing memory but not in 16f526 that use FSR register , maybe is this cause of error ?

    Thanks in advance

    Orlando

     #Chip 16f526,8
     #option explicit
    

    ; ----- Define Hardware settings
    ' Dir SerInPort In
    DIR portb in ' setta porta in ingresso per evitare cortocircuiti
    DIR portb.0 in ' TASTO +
    DIR portb.1 in ' TASTO -
    DIR portb.2 in ' ADC3

    DIR portc in' setta porta in ingresso per evitare cortocircuiti
    DIR portc.0 Out
    DIR portc.1 Out
    DIR portc.2 Out
    DIR portc.3 Out
    DIR portc.4 Out
    DIR portc.5 Out'*Relais
    ; ----- Constants
    ' FlagVari :
    '.0= Puntatore per lampeggio led
    '.7= 0 Fine Timer 1= Timer1 ON
    ; ----- Variables
    DIM FlagVari as byte 'puntatori vari
    DIM adval as byte 'variabile per ADC0
    DIM IndPot as byte 'variabile per Indicatore potenza
    DIM RelaisVal as byte 'variabile per soglia relais
    DIM Rit1 as byte 'variabile per ritardo
    DIM Rit2 as byte 'variabile per ritardo
    DIM Rit3 as byte 'variabile per ritardo
    DIM Rit4 as byte 'variabile per ritardo
    DIM INDEPROM as byte 'variabile per eprom
    Rit4=0
    adval=0
    IndPot=0

    EPRead 1,RelaisVal
    ...
    ...
    ...

     
    • Anobium

      Anobium - 2017-10-11

      I can not reproduce. Can you please try with the latest version of GCBASIC.

       
  • William Roth

    William Roth - 2017-10-11

    @Evan
    The error can easily be produced by loading the user program in GCB 98 and clicking on make/hex.

    @Orlando
    The problem can easily be solved by using a chip that actually has eeprom. This chip (16F526) has no "EEPROM" memory. It has Flash Data Memory which aparantly does not work with the GCB EEPROM library. Therefore the error message.

    The 16F526 is an old barebones (low memory) microcontroller that is not very well suited for use with GBG except for minimal applications that require very little memory.

    My suggestion to you is to get a more modern microcontroller that is better suited to GCB and to your application. A PIC16F1825 should work nicely as should some other 14-Pin PIC chips..

    UPDATE: The root cause appears to be a compiler issue (GCASM) where the compiler thinks thic chip has Bit RP0 (Status,5) when it instead has a similar Bit (PA0) Status,5).

    The second line in code below will cause the error

    MOVLW, 0
    MOVFW EEADR

    WIlliam

     

    Last edit: William Roth 2017-10-11
  • Orlando D.

    Orlando D. - 2017-10-12

    Thanks for support , at this point i will replace old pic16f526 with another type.

    Ciao
    Orlando

     
  • Anobium

    Anobium - 2017-10-12

    This is Known Issue. Known Issue #17, see your installation for other known issue ...GCB@Syn\GreatCowBasic\Documentation\Known Issues In This Release.pdf

    This is from the PDF... KI#17 When using GCASM you may an error - Error: GCASM: Symbol RP0 has not been defined. To resolve please use Great Cow BASIC to generate your ASM then use MPASM to generate your Hex file.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.