Array -- something wrong?


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    I see I did it again in my reply (for 1 to 12)

    trust me -- it's for 0 to 12

    jeeez

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Michael, I'm no expert but some of your references to DATAIN include brackets and an array element identifier after them, others don't.
    In the serin command does picbasic know to put the received data byte into sequential bytes of the datain array, or should yo be putting that command in a loop and incrementing the array pointer with every pass through ?

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Chris --

    I've never used array either in picbasic anyway.

    You're probably right -- there has to be more to the serin code than what I have shown. ? But all I see with SERIN in the books is how I have it set up.

    I do get some action if I use separate byte variables rather than an array --

    like [QUAL1,QUAL2],b0,b1,b2,b3,b4 etc

    but I really want to use an array -- and to learn how as well.

    Everything is setup fine on the breadboard -- I see the data with my scope etc.

    Maybe someone can point to the problem, in the mean time I need to study some more on it.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Look at SERIN2.
    Dave
    Always wear safety glasses while programming.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Michael View Post
    Chris --

    You're probably right -- there has to be more to the serin code than what I have shown. ? But all I see with SERIN in the books is how I have it set up.

    .
    Working with the condition that you know you will receive 13 bytes of data in advance

    For Bytes = 0 to 12
    SerIn PORTA.0,N1200,[QUAL1,QUAL2],DATAIN[Bytes]
    Next

    Does the SerIn command also have a timeout which is similar to how I remember Hserin working, IE if no data is received for a predefined period the command makes a jump to another label in order to escape the loop.

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Ok -- I'll try that -- I would have thought it would automatically load all the bytes you declare in the array.

    Whatever -- I'll try it. thanks.

  7. #7


    Did you find this post helpful? Yes | No

    Default

    still no luck -- 2 days on this.

    I think "STR" needs to be in there somewhere but as always the PBP manual is extremely vague and can't google much on it.

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Did you see post #10 ?
    Dave
    Always wear safety glasses while programming.

Members who have read this thread : 1

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