Array error in Hserin


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,127


    Did you find this post helpful? Yes | No

    Default Re: Array error in Hserin

    Aha! Thanks Richard.

    pedja089, you mean instead of

    @word_array_asbyte=word_array

    be:

    @ _word_array_asbyte= _word_array

    right?

    Ioannis

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: Array error in Hserin

    @ word_array_asbyte= _word_array
    Warning I'm not a teacher

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,127


    Did you find this post helpful? Yes | No

    Default Re: Array error in Hserin

    I am facing a problem with arrays.

    The task is to grab 10bits of ADC result into array elements.

    This works OK:

    word_temp.byte0=adresl
    word_temp.byte1=adresh
    array[i]=word_temp

    But this does not:

    array.highbyte[i]=adresh
    array.lowbyte[i]=adresl

    Is something wrong with the above syntax?

    Ioannis

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: Array error in Hserin

    array[i]=(adresh<<8)|adresl


    or
    using ext modifier
    array_asbyte[i*2]=adresl
    array_asbyte[i*2+1]=adresh
    Warning I'm not a teacher

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,127


    Did you find this post helpful? Yes | No

    Default Re: Array error in Hserin

    Thanks Richard.

    Comparing the

    array[i]=(adresh<<8)|adresl

    takes about 10 words more on compilation than

    word_temp.byte0=adresl
    word_temp.byte1=adresh
    array[i]=word_temp

    Have not tested the EXT version yet.

    Ioannis

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,127


    Did you find this post helpful? Yes | No

    Default Re: Array error in Hserin

    And the EXT version... 30 words more!!!

    I think is too much.

    Ioannis

Similar Threads

  1. Hserin with Array
    By JKaiser in forum Serial
    Replies: 4
    Last Post: - 11th December 2014, 19:13
  2. Hserin Array Question
    By Hylan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th May 2012, 02:39
  3. Error - Fatal Out Of Memory ( With Array)
    By stormdacta in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th August 2007, 14:36
  4. Bit/Byte array for Hserin/Hserout
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st September 2006, 23:07
  5. HSERIN Error
    By eoasap in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 13th January 2006, 03:30

Members who have read this thread : 0

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

Posting Permissions

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