Today 17:43
Forum: Proton Plus Compiler v3
Starter: kuhrig
Views: 0
Replies: 2
Today 12:22
Forum: Website / Forum Issues
Starter: rcurl
Views: 0
Replies: 10
Today 09:13
Forum: The Lounge
Starter: Les
Views: 0
Replies: 8
+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: Dim xxx as code problem on P2491 days old

  1. #1
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,194
    Thumbs Up
    Received: 70
    Given: 37
    Total Downloaded
    2.68 GB

    0 Not allowed!

    Default Dim xxx as code problem on P24

    I have just spent two days on a problem and I think it is a problem in text handling "As Code" in P24.
    I have reduced it as far as I can. Running this should give:

    0 29
    1 30
    2 31 etc

    But it actually gives:

    0 255
    1 255
    2 255
    3 255
    4 232
    5 2
    6 0
    Reached end of ip text

    Can somebody point me in the right direction please. Compiler vsn: 1.0.5.0

    Charlie

    Device = 24HJ128GP502
    Declare Xtal = 79.23
    Declare Stack_Size = 400
    Declare Hserial1_Baud = 9600
    Declare Hserial2_Baud = 9600
    Declare HRSOut1_Pin = PORTB.8
    Declare HRSIn1_Pin = PORTB.9
    Declare HRSOut2_Pin = PORTB.10
    Declare Optimiser_Level = 2
    Declare Dead_Code_Remove = On
    PLL_Setup(43, 2, 2, $0300)

    PPS_Output(cOut_Pin_RP8, cOut_Fn_U1TX) ;put uart1 output on RB8 (Peripheral remapping PPS)
    PPS_Input(cIn_Pin_RP9, cIn_Fn_U1RX) ; .. .. input on read_sram
    PPS_Output(cOut_Pin_RP10, cOut_Fn_U2TX) ;put uart2 output on RB10
    PPS_Input(cIn_Pin_RP11, cIn_Fn_U2RX) ; .. .. input on RB11

    Dim ip_char As Byte
    Dim chc_ptr As Word

    Dim text_text As Code = As Byte 29, 30, 31, 8, 5, 12, 12, 15, 27, 9, 29, 30, 31, 2, 5, 7, 9, 14, 27, 9, 29, 30, 00

    chc_ptr = 0
    While
    ip_char = CRead8 text_text[chc_ptr]
    HRSOut Dec chc_ptr, " ", Dec ip_char , "\r\n"
    Inc chc_ptr
    If ip_char = 0 Then
    HRSOut " Reached end of ip text "
    Stop
    EndIf
    Wend

    Config FBS = BWRP_WRPROTECT_OFF, BSS_NO_FLASH, BSS_NO_BOOT_CODE
    Config FSS = SWRP_WRPROTECT_OFF, SSS_NO_FLASH, RSS_NO_SEC_RAM
    Config FGS = GWRP_OFF, GCP_OFF
    Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
    Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSDCMD
    Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
    Config FPOR = FPWRT_PWR128, ALTI2C_OFF
    Config FICD = ICS_PGD1, JTAGEN_OFF

  2. #2
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,194
    Thumbs Up
    Received: 70
    Given: 37
    Total Downloaded
    2.68 GB

    1 Not allowed!

    Default Re: Dim xxx as code problem on P24

    After trying to revert to an earlier vsn of the compiler, I now can't do anything!

    I loaded an earlier vsn and, with the source above, it said "Error in device info section of ppi file"

    Please, can somebody advise me what to do about this. I have download the latest vsn again but I still get the ppi error.

    Charlie (at wit's end)

  3. #3
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,194
    Thumbs Up
    Received: 70
    Given: 37
    Total Downloaded
    2.68 GB

    0 Not allowed!

    Default Re: Dim xxx as code problem on P24

    I have removed the whole Proton compiler suite, then downloaded the latest vsn from the forum website. It seemed to install OK.
    The IDE is there, I can load a source but when I press Compile, it searches for the actual compiler, and gives up "Unable to locate compiler".

    Any ideas?
    Charlie

    I presume that C:\Program files(x86)\ProtonIDE\PDS\ App.exe and App24.exe are the actual compilers? They are present in the file but the IDE doesn't know where they are???
    Last edited by charliecoultas; 25th June 2018 at 16:31.

  4. #4
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,921
    Thumbs Up
    Received: 35
    Given: 11
    Total Downloaded
    201.76 MB

    0 Not allowed!

    Default Re: Dim xxx as code problem on P24

    I copied as is and it compiled ok.

    I like to keep certain orders, so I shuffled the code a bit... which also compiles ok.

    Device = 24HJ128GP502
    Declare Xtal = 79.23

    Config FBS = BWRP_WRPROTECT_OFF, BSS_NO_FLASH, BSS_NO_BOOT_CODE
    Config FSS = SWRP_WRPROTECT_OFF, SSS_NO_FLASH, RSS_NO_SEC_RAM
    Config FGS = GWRP_OFF, GCP_OFF
    Config FOSCSEL = FNOSC_FRCPLL, IESO_OFF
    Config FOSC = POSCMD_NONE, OSCIOFNC_ON, IOL1WAY_OFF, FCKSM_CSDCMD
    Config FWDT = WDTPOST_PS256, WINDIS_OFF, FWDTEN_OFF
    Config FPOR = FPWRT_PWR128, ALTI2C_OFF
    Config FICD = ICS_PGD1, JTAGEN_OFF

    Declare Stack_Size = 400
    Declare Hserial1_Baud = 9600
    Declare Hserial2_Baud = 9600
    Declare HRSOut1_Pin = PORTB.8
    Declare HRSIn1_Pin = PORTB.9
    Declare HRSOut2_Pin = PORTB.10
    Declare Optimiser_Level = 2
    Declare Dead_Code_Remove = On
    PLL_Setup(43, 2, 2, $0300)

    PPS_Output(cOut_Pin_RP8, cOut_Fn_U1TX) ;put uart1 output on RB8 (Peripheral remapping PPS)
    PPS_Input(cIn_Pin_RP9, cIn_Fn_U1RX) ; .. .. input on read_sram
    PPS_Output(cOut_Pin_RP10, cOut_Fn_U2TX) ;put uart2 output on RB10
    PPS_Input(cIn_Pin_RP11, cIn_Fn_U2RX) ; .. .. input on RB11

    Dim ip_char As Byte
    Dim chc_ptr As Word

    Dim text_text As Code = As Byte 29, 30, 31, 8, 5, 12, 12, 15, 27, 9, 29, 30, 31, 2, 5, 7, 9, 14, 27, 9, 29, 30, 00

    chc_ptr = 0
    While
    ip_char = CRead8 text_text[chc_ptr]
    HRSOut Dec chc_ptr, " ", Dec ip_char , "\r\n"
    Inc chc_ptr
    If ip_char = 0 Then
    HRSOut " Reached end of ip text "
    Stop
    EndIf
    Wend

    End
    Fanie

  5. #5
    Fanatical Contributor fanie's Avatar
    Join Date
    Oct 2005
    Posts
    7,921
    Thumbs Up
    Received: 35
    Given: 11
    Total Downloaded
    201.76 MB

    0 Not allowed!

    Default Re: Dim xxx as code problem on P24

    In the editor look under view, editor options, general, and see if it points to the correct location on your PC.
    Mine points to the user files C:\Users\Fanie\PDS\

    Aren't you suppose to start the new program with the blinking LED ?
    Last edited by fanie; 26th June 2018 at 20:40.
    Fanie

  6. #6
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,194
    Thumbs Up
    Received: 70
    Given: 37
    Total Downloaded
    2.68 GB

    0 Not allowed!

    Default Re: Dim xxx as code problem on P24

    Fanie

    Thanks for replying. There are now two issues:

    It always compiled OK and ran. But it gave the wrong results. I reduced the size to a "compilable snippet". I suspect the compiler doing something wrong so I tried to load a prevous version. Then the trouble started proper.

    An older compiler complained about the ppi file so I tried to restore the latest version.

    Now the editor loads my source but when I press COMPILE it searches for the compiler and eventually gives up.

    I checked what you said, and it points to the correct place.

    Totally stumped!

    Charlie

    I did the flashing LED years ago. This snippet is from a much larger source which uses the RF generator board that Les kindly wrote the code for. But I can't try it!

  7. #7
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    400
    Thumbs Up
    Received: 38
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Dim xxx as code problem on P24

    Two thinghs you can try.
    One. Complete shut/power-down meaning no connection to AC-source and Notebook, remove also the batterie.
    Of course power down first as useal, then remove power cord/batterie.
    If memory addresses are corrupted, it will reset itself. (I had this twice on Notebook and PC).
    Drink a cup of coffee, after ten minutes, reboot.

    If that didn't help;
    Two. Revert to the last working state of the computer I'll think it would be june 24(before posting date?),
    computer make snapshots from time to time, if you didn't disable it.
    But. backup important files first, because it is windows you know.

  8. #8
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,771
    Thumbs Up
    Received: 151
    Given: 152
    Total Downloaded
    3.03 GB

    0 Not allowed!

    Default Re: Dim xxx as code problem on P24

    I'm not sure about the first suggestion but the location (not the executable) of the compiler is set in "View/Compile and Program Options/Find Manually" and set to "ProgramDirectory/ProtonIDE/PDS" - so probably "C:\Program Files (x86)\ProtonIDE\PDS" where there should be atleast App.exe, App24.exe and PrPlus.exe.

    If you just update (or downgrade) App24.exe you may well have a problem with PPI and DEF files. Unless otherwise told, always do a full install, get that woking then if necesary overwrite App24.exe with any update.
    George

  9. #9
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,194
    Thumbs Up
    Received: 70
    Given: 37
    Total Downloaded
    2.68 GB

    0 Not allowed!

    Default Re: Dim xxx as code problem on P24

    George, I think you may have found the answer. I'm at work at present but will try it later when I get home.
    Many thanks in advance.

    Thanks Henk but I already tried most of that (it's a desktop machine, no batteries.)
    Last edited by charliecoultas; 27th June 2018 at 16:44.

  10. #10
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,194
    Thumbs Up
    Received: 70
    Given: 37
    Total Downloaded
    2.68 GB

    0 Not allowed!

    Default Re: Dim xxx as code problem on P24

    Dammit! The directory chain in the "Find manually" is correct. The two compiler files are there but the editor refuses to "see" them. It's as though it is looking somewhere else entirely. Good try George, I thought that was it.

    I have tried copying the two compiler files and putting them in various places, then altering the "find manually" chain but nothing seems to work.
    It's as though the Win10 system is screwed up (and after a mere 50 years of development it is probably expecting a bit too much for it to be trouble-free).

    Thanks George, Henk

    I'm considering window cleaning, it's less stressful.

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Using Dim as Code
    By SimonJA in forum Proton 24
    Replies: 9
    Last Post: 8th January 2018, 15:04
  2. how to implement DIM AS CODE
    By lordfrank1 in forum Projects discussion
    Replies: 7
    Last Post: 15th June 2015, 14:57
  3. Problem with Fuse Configurator and P24/33 devices
    By johngb in forum Fuse Configurator
    Replies: 1
    Last Post: 3rd April 2014, 18:38
  4. 16f690, dim and tmr0 problem
    By zerone in forum Proton Plus Compiler v3
    Replies: 7
    Last Post: 7th March 2011, 07:11
  5. [SOLVED !] problem with code
    By wchpikus in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 7th July 2007, 03:20

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