[SOLVED !] STR problem or compiler bug?


Closed Thread
Results 1 to 12 of 12

Thread: STR problem or compiler bug?4335 days old

  1. #1
    BeamSystems
    Guest BeamSystems's Avatar

    0 Not allowed!

    Default STR problem or compiler bug?

    Hi,

    When I compile the following lines (part of a much bigger program) it won't send anything:

    DEVICE = 16F648A
    CONFIG HS_OSC, WDT_OFF, PWRTE_OFF, BODEN_OFF, LVP_OFF, CP_OFF
    XTAL = 20
    ALL_DIGITAL = TRUE
    OPTIMISER_LEVEL = 0

    SYMBOL RS232out = PORTA.4

    DIM FW[5] AS BYTE
    DIM HW[7] AS BYTE

    STR FW = "6.4b",0
    STR HW = "803027",0

    SEROUT RS232out,84,[STR FW,13,STR HW,13]


    But if I use this it works:

    SEROUT RS232out,84,["6.4b",13, "803027",13]

    Am I doing something wrong or is it a compiler bug?

    (I'am using latest compiler version)

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Prolific Poster bill9399's Avatar
    Join Date
    Aug 2004
    Posts
    1,701
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    1.13 GB

    0 Not allowed!

    Default

    Quote Originally Posted by BeamSystems View Post
    Hi,

    When I compile the following lines (part of a much bigger program) it won't send anything:

    DEVICE = 16F648A
    CONFIG HS_OSC, WDT_OFF, PWRTE_OFF, BODEN_OFF, LVP_OFF, CP_OFF
    XTAL = 20
    ALL_DIGITAL = TRUE
    OPTIMISER_LEVEL = 0

    SYMBOL RS232out = PORTA.4

    DIM FW[5] AS BYTE
    DIM HW[7] AS BYTE

    STR FW = "6.4b",0
    STR HW = "803027",0

    SEROUT RS232out,84,[STR FW,13,STR HW,13]


    But if I use this it works:

    SEROUT RS232out,84,["6.4b",13, "803027",13]

    Am I doing something wrong or is it a compiler bug?
    try replacing the lines

    STR FW = "6.4b",0
    STR HW = "803027",0
    with the following

    STRN FW = "6.4b"
    STRN HW = "803027"

    (I'am using latest compiler version)
    Which latest version of the compiler are you using?
    A wise man may listen and say nothing. A fool may listen and have nothing to say. Which one are you???

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    BeamSystems
    Guest BeamSystems's Avatar

    0 Not allowed!

    Default

    I use 3.2.5.5 and this:

    STRN FW = "6.4b"
    STRN HW = "803027"

    doesn't work (it compiles ok, but I'm not recieiving the data, it's blank).

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    bruce
    Guest bruce's Avatar

    0 Not allowed!

    Default

    Is RA4 an open drain output?

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Prolific Poster bill9399's Avatar
    Join Date
    Aug 2004
    Posts
    1,701
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    1.13 GB

    0 Not allowed!

    Default

    Quote Originally Posted by bruce View Post
    Is RA4 an open drain output?
    Correct. Just checked the datasheet.
    BeamSystems. Try using a different pin.
    A wise man may listen and say nothing. A fool may listen and have nothing to say. Which one are you???

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #6
    Prolific Poster bill9399's Avatar
    Join Date
    Aug 2004
    Posts
    1,701
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    1.13 GB

    0 Not allowed!

    Default

    BeamSystems. Use a 4k7 pullup resistor to VCC from RA4.
    A wise man may listen and say nothing. A fool may listen and have nothing to say. Which one are you???

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #7
    BeamSystems
    Guest BeamSystems's Avatar

    0 Not allowed!

    Default

    The pin is not the problem (it has a pullup) and this:

    SYMBOL RS232out = PORTA.4
    SEROUT RS232out,84,["6.4b",13, "803027",13]

    works fine!

    So what is the solution? I can't figure it out...

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #8
    Prolific Poster bill9399's Avatar
    Join Date
    Aug 2004
    Posts
    1,701
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    1.13 GB

    0 Not allowed!

    Default

    Quote Originally Posted by BeamSystems View Post
    The pin is not the problem (it has a pullup) and this:

    SYMBOL RS232out = PORTA.4
    SEROUT RS232out,84,["6.4b",13, "803027",13]

    works fine!

    So what is the solution? I can't figure it out...
    I can't see anything wrong with the code.

    Unfortunately I can't simulate the particular pic in the limited version of Isis installed with Proton.
    If your copy of Proton is a licensed full version, not the Lite version, have your user status on the forum updated, then download the latest pre-release version and try that..
    I also suggest you ask if some very kind person, with a full version of Proteus, would simulate your test program for you.
    A wise man may listen and say nothing. A fool may listen and have nothing to say. Which one are you???

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #9
    BeamSystems
    Guest BeamSystems's Avatar

    0 Not allowed!

    Default

    Thanks for the effort!

    I have a full license (my user status is pending to be updated). I will then try it with the pre-release version.

    The funny thing is that when I use a 18F1320 PIC, it works fine... (I think, not 100% sure about it)

    Maybe some limitation with the 16F series?

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #10
    wtriska
    Guest wtriska's Avatar

    0 Not allowed!

    Default

    Just for fun, try padding some spaces between the variable names and the commas (e.g. SEROUT RS232out , 84 , [STR FW ,13 ,STR HW , 13] and lengthening the variable names (stringFW , stringHW).

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #11
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default

    Compile for the free VSM in the 16f877 and look at what is happening in the variables then send the data out, and compare

    Use hrsout and Rsout etc for comparison, as the terminal is not on ra4, if it works ok then your fault lies in the use of RA4
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #12
    BeamSystems
    Guest BeamSystems's Avatar

    0 Not allowed!

    Default

    Quote Originally Posted by wtriska View Post
    Just for fun, try padding some spaces between the variable names and the commas (e.g. SEROUT RS232out , 84 , [STR FW ,13 ,STR HW , 13] and lengthening the variable names (stringFW , stringHW).
    Tried that but didn't solve the problem.

    When I use this:

    DEVICE = 16F648A
    CONFIG HS_OSC, WDT_OFF, PWRTE_OFF, BODEN_OFF, LVP_OFF, CP_OFF
    XTAL = 20
    ALL_DIGITAL = TRUE
    OPTIMISER_LEVEL = 0

    DIM firmware[5] AS BYTE
    DIM hardware[7] AS BYTE

    STRN firmware = "6.4b"
    STRN hardware = "803027"

    SYMBOL RS232out = PORTA.4
    SEROUT RS232out,84, ["FW: ",STR firmware,13,"HW: ",STR hardware,13]

    I see this in my RS232 terminal:

    FW:
    HW:

    The two strings (firmware & hardware) are not displayed.

    I don't think is a pin problem, because I won't work with another pin either.


    Can it be that the STR methode doesn't work with 16F series PIC?

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

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

       

    Similar Threads

    1. Problem with Str$ instruction.
      By kbaykar in forum Proton Plus Compiler v3
      Replies: 21
      Last Post: 7th June 2016, 01:50
    2. Str$ Problem
      By Fire_IC in forum Proton Plus Compiler v3
      Replies: 3
      Last Post: 9th August 2009, 11:32
    3. [SOLVED !] Compiler problem (Dare I say bug ?) Confirmed with Hserial 4800 baud
      By Kapitan in forum Proton Plus Compiler v3
      Replies: 8
      Last Post: 18th January 2009, 11:50
    4. [SOLVED !] Problem with Hserout Str
      By maca_404 in forum Proton Plus Compiler v3
      Replies: 3
      Last Post: 24th July 2008, 15:31
    5. A compiler bug?
      By llimis in forum Proton Plus Compiler v3
      Replies: 7
      Last Post: 18th April 2008, 02:19

    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