Go to last post By: towlerg
Today 13:36
Forum: FineLine IDE
Starter: normnet
Views: 33570
Replies: 122
Today 13:16
Forum: Proton Plus Compiler v3
Starter: Henk57
Views: 0
Replies: 13
Yesterday 20:20
Forum: Proton Plus Compiler v3
Starter: Dave-S
Views: 0
Replies: 0
Yesterday 18:25
Forum: The Lounge
Starter: Henk57
Views: 0
Replies: 104
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: About EREAD Command in Version 3.5.9.9371 days old

  1. #1
    Member SELCUK's Avatar
    Join Date
    Sep 2006
    Posts
    173
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    365.10 MB

    0 Not allowed!

    Default About EREAD Command in Version 3.5.9.9

    Hi All,

    Today, I try to compile to make some fix on my old project with compiler version 3.5.9.9 on window 10 64-bits operating system and get Error while using EREAD Command. If I compile same file with compiler version 3.5.8.6 there is no Error while using EREAD Command. And Program works what I expected.

    So, Am I make some mistake while using EREAD command?

    Can anyone guide to me?

    Picmicro Device is pic18f8722, PLL is ON and XTAL is 10 MHz...

    Best Regards,

    Selcuk
    [url]www.sfy.com.tr[/url]

  2. #2
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    2,898
    Thumbs Up
    Received: 294
    Given: 109
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: About EREAD Command in Version 3.5.9.9

    What is the error message Selcuk? I've just tried the Eread command on a PIC18F8722 using version 3.5.9.9, and no errors are given, and the code works fine. For example:

    Code:
        Device = 18F8722
        Declare Xtal = 10
        Declare PLL_Req = On
    
        Dim MyByte As Byte
        Dim MyWord As Word
            
    MyEeprom EData 0, 1, 2, 3, 4, 5
    
        MyByte = ERead MyEeprom
        MyWord = ERead MyEeprom + 1
    Last edited by Les; 13th July 2017 at 14:36.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  3. #3
    Member SELCUK's Avatar
    Join Date
    Sep 2006
    Posts
    173
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    365.10 MB

    0 Not allowed!

    Post Re: About EREAD Command in Version 3.5.9.9

    Hi,


    Thank you for reply.

    There is no ERROR MESSAGE at all...

    Here is a small sample code that what I do in my code:

    at System Configuration Routine:


    ...
    REST OF OTHER CODES


    SYSTEM_CONFIG:


    KONFIG = EREAD 16


    IF KONFIG <> $08 THEN


    ...


    BAUD_RATE = CREAD mBaudRate
    EWRITE 110, [BAUD_RATE]
    DELAYMS 10
    GOSUB BAUD_RATE_TABLE
    GOSUB INIT_EUSART


    ...


    ELSE


    ...
    BAUD_RATE = EREAD 110
    GOSUB BAUD_RATE_TABLE
    GOSUB INIT_EUSART
    ...


    ENDIF

    RETURN

    Here is baudrate table and eusart init routines.

    INIT_EUSART:


    ASM-
    BCF RCSTA,CREN ;// reset the receiver logic CREN = 0
    ENDASM-

    RCSTA = $90 ;// Enable serial port & continuous receive
    TXSTA = $24 ;// Enable transmit, BRGH = 1


    SPBRG = aBAUD


    ASM-
    BSF RCSTA,CREN ;// enable reception again CREN = 1
    ENDASM-


    WREG = RCREG ;// Clear receive register

    RETURN


    BAUD_RATE_TABLE:
    ;// 115200, 57600, 56000, 38400, 36000, 28800, 19200, 14440, 9600
    aBAUD = LOOKUP BAUD_RATE, [21, 42, 44, 64, 68, 86, 129, 173, 255] ;// LOOKUP TABLE FOR SPBRG VALUES


    RETURN

    REST OF OTHER CODES


    In the code eusart must be initialize at 38400 baudrate and this value must be display on lcd for new configuration. But on lcd there is 00000 display instead of 38400 and there for eusart not initialize... This situation is also true for some other configuration parameters. For example display unit, display language, calibration parameter for analog channel etc...


    But if I compile same code with version 3.5.8.6 there is no problem and system works what I expected. Due to this situation, I write to the forum.

    Best Regards,

    Selcuk...

    CompMessages.JPG
    Last edited by SELCUK; 14th July 2017 at 10:39.
    [url]www.sfy.com.tr[/url]

  4. #4
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    2,898
    Thumbs Up
    Received: 294
    Given: 109
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: About EREAD Command in Version 3.5.9.9

    That's a hint that I got rid of in the new compiler version. All it is telling you is that it is reserving RAM at the top of RAM memory, so I got rid of it, so the code usage etc can be seen because warnings and hints both take over the important RAM and code size information.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  5. #5
    Member SELCUK's Avatar
    Join Date
    Sep 2006
    Posts
    173
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    365.10 MB

    0 Not allowed!

    Default Re: About EREAD Command in Version 3.5.9.9

    Hi,

    Thank you for interest and reply. Anyway, Now, I re-use version 3.5.8.6.

    Best Regards,

    Selcuk
    [url]www.sfy.com.tr[/url]

  6. #6
    Junior Member Gianluca's Avatar
    Join Date
    Feb 2014
    Posts
    2
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: About EREAD Command in Version 3.5.9.9

    EREAD function for micro 18F26K22


    When you direct a Micro EEPROM cell directly to example:




    Dim V_EPC As Byte 'Variable for reading Eprom



    V_EPC = ERead $ 0E 'reading in Eprom micro




    Reading happens randomly in the address ($ 0E, $ 10E, $ 20E, $ 30E),


    Or rather depends on the last reading made with address> $ FF


    It seems that with the <$ 100 address reading the "EEADRH" registry is not fixed,


    See system routines "__EEREAD_ and __EEREAD_W_"

    Sorry for poor English
    But I translated it with google
    Thank you so much
    Gianluca / Tellab Italy

  7. #7
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    2,898
    Thumbs Up
    Received: 294
    Given: 109
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: About EREAD Command in Version 3.5.9.9

    I need a code snippet so I can test it and see any possible anomaly. The compiler is very dynamic in the way it produces code and variables etc, so I need to see any variables and syntax etc...
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  8. #8
    Member SELCUK's Avatar
    Join Date
    Sep 2006
    Posts
    173
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    365.10 MB

    0 Not allowed!

    Default Re: About EREAD Command in Version 3.5.9.9

    Hi,

    If I try to use in a small code sample, there is no error and It works well for EREAD, EWRITE and CREAD commands. But in a huge program (that is more than 65 KBytes), there is unusual working with EREAD, EWRITE or CREAD commands. May be I make some mistake but same code works in complier version 3.5.8.6.

    NOTE: The above explanation is also true for Complier version 3.6.0.2

    Best Regards,

    Selcuk
    Last edited by SELCUK; 30th August 2017 at 10:38.
    [url]www.sfy.com.tr[/url]

  9. #9
    Junior Member Gianluca's Avatar
    Join Date
    Feb 2014
    Posts
    2
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    0

    0 Not allowed!

    Default Re: About EREAD Command in Version 3.5.9.9

    ================================================== ==========================
    STARTP:
    Device 18F26K22
    Declare Xtal=20
    All_Digital = True ' Set PORTA and PORTE to all digital
    ;------------------------- ' Uscite seriale 1
    Declare Hserial_Baud = 9600 ' Set baud rate to 9600
    Declare Hserial_RCSTA = %10010000 ' Enable serial port receive
    Declare Hserial_TXSTA = %00100100 ' Enable transmit

    Dim V_EPC As Byte ' Valore da per Eprom o da eprom
    '================================================= ========
    '** INIZIO PROGRAMMA ***
    '================================================= ========
    MAIN:
    EWrite $0E,[22]
    DelayMS 10
    EWrite $10E,[55]
    DelayMS 10


    Lett:
    V_EPC=ERead $0E
    HSerOut [Dec3 V_EPC,13] ; Value read "55" It had to be "22"


    V_EPC=ERead $10E
    HSerOut [Dec3 V_EPC,13,13] ; Value read "55"


    DelayMS 3000
    GoTo Lett
    ;----------------------------------------
    End
    ' ------------------------------------


    ================================================== =================================
    ================================================== =================================


    ==============================================
    assembler sviluppato dal proton PIC 18F26K22
    ==============================================
    F1_000021 equ $ ; IN [TK22_PROA.BAS] V_EPC=EREAD $0E
    movlw 14
    rcall __EEREAD_
    movwf V_EPC,0
    .
    .
    F1_000024 equ $ ; IN [TK22_PROA.BAS] V_EPC=EREAD $10E
    movlw 1
    movwf EEADRH,0
    movlw 14
    movwf EEADR,0
    rcall __EEREAD_W_
    movwf V_EPC,0
    .
    .


    ---------------------------
    routines di sistema chiamate
    ---------------------------
    __EEREAD_
    movwf EEADR,0
    __EEREAD_W_
    clrf EECON1,0
    bsf EECON1,PP_RD
    movf EEDATA,W,0
    infsnz EEADR,F,0
    incf EEADRH,F,0
    return


    ;================================================= =============
    The register ( EEADRH ) NOT set during reading (F1_000021),
    But it stays with the last set value, and misses the reading.
    ;================================================= ==========
    Thank you so much
    Gianluca / Tellab Italy

  10. #10
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    2,898
    Thumbs Up
    Received: 294
    Given: 109
    Total Downloaded
    1.50 GB

    1 Not allowed!

    Default Re: About EREAD Command in Version 3.5.9.9

    Thanks for the code snippet. You were spot on with the reason, which is so refreshing to read :-)

    The compiler was not loading SFR EEADRH for eread if the address was an 8-bit constant value on devices that have more than 256 bytes of on-board eeprom. This has now been corrected and an App.exe file has been uploaded to the files section.

    Proton version 3.6.0.3 patch
    Last edited by Les; 30th August 2017 at 19:16.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. EWrite/ERead
    By t0pP8uZz in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 11th December 2009, 15:47
  2. Indexing EREAD
    By shantanu@india in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 1st May 2008, 13:06
  3. Eread Byte
    By crankshaft in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 13th May 2007, 13:02

Members who have read this thread since 15th July 2018, 15:44 : 0

Actions :  (Set Date)  (Clear Date)

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts