Shiftout - shiftin question


Closed Thread
Results 1 to 9 of 9

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Looks really close to the Basic Stamp code but one big difference when switching to PBP is many of the chips have analog built in.

    Just about every pin on the 690 has analog. So read through this
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    and the data sheet.

    For the 690 to turn off the analog you will need to add this near the beginning.
    Code:
    CM1CON0 = 0  'Should turn off the Comparators
    CM2CON0 = 0
    ANSEL = 0       'Turns ADC off
    You may want to start off with a simple "blinky" program just to make sure the 690 is running correctly.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Apr 2010
    Location
    Sweden
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Thank you!
    It was really good information. I missed this analog thing. Now the PIC seems to work more logic, or moore like a stamp. But it still dont work with this compass-module. I think that I will start to test the same things I allready have done before I typed this new strip, and maybee et will work. If you don´t have any moore good information I maybee have missed?
    I get back here and tell how it was going.
    / Lasse

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


    Did you find this post helpful? Yes | No

    Default

    What version of PBP are you using?

    And you may want to look at the source code compared to your code. There was a couple things I think missing but have not had a chance to really pick it over.

    But first, is the PIC® running? Can you make an LED blink at an expected rate. Maybe it is not running at the correct speed?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Apr 2010
    Location
    Sweden
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Hello again.
    Thanks for your engagement!
    It is still dont working.

    I think that I have the latest and best PBP-version. I baught it last week.
    The code is allmost a copy from the sourse-code (made for Basic stamp where it works). And I checked the speed. It seems to me as it is correct. I light a led up and paused for 10 000. Checked, and it was 10 sek.
    I think I tryed everything. Now I am really drained of ideas.
    You are more than welcome to came up with new ideas.
    Friendly regards / Lasse
    Last edited by Lasse1; - 5th April 2010 at 15:54.

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


    Did you find this post helpful? Yes | No

    Default

    Looking at your code again
    Code:
    SHIFTIN DinDout,clk,MSBPOST,[Status\4] ' Get Status
    
    LOOP UNTIL s = Ready ' Exit loop when status is ready
    I do not see a "Status" array variable defined but I do see a "s" variable.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Apr 2010
    Location
    Sweden
    Posts
    10


    Did you find this post helpful? Yes | No

    Default

    Thanks again.
    I think that I tried it before. Type "SHIFTIN DinDout,clk,MSBPOST,[S\4]" instead of "status". But now I tried again. It dont work. Do you think that it is some different depending of witch pins I use? Do I need to try different pins every change I try?
    Friendly regards / Lasse

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