LTC2400 SPI interface


Closed Thread
Results 1 to 27 of 27

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

    I have not used that part but a quick look at the data sheet says you should be able to use the SHIFTIN command in Pic Basic Pro.

    You posted in PIC BASIC. Is that what you are using or are you using the Pro version?

    The 690 also has a built in ADC.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    May 2010
    Location
    SINGAPORE
    Posts
    14


    Did you find this post helpful? Yes | No

    Red face thanks for your reply

    Quote Originally Posted by mackrackit View Post
    I have not used that part but a quick look at the data sheet says you should be able to use the SHIFTIN command in Pic Basic Pro.

    You posted in PIC BASIC. Is that what you are using or are you using the Pro version?

    The 690 also has a built in ADC.
    am using BASIC and oshonsoft compiler.
    i tried using the internal adc and its worked but i want to communicate with external adc using spi interface.please help me my friend.

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


    Did you find this post helpful? Yes | No

    Default

    This is an example for EEPROMS
    http://melabs.com/resources/samples/x1/pbp/spix.htm
    You should be able to modify it for the ADC
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    May 2010
    Location
    SINGAPORE
    Posts
    14


    Did you find this post helpful? Yes | No

    Question thanks for your reply

    why the command set changes even all the codes are in basic language.In the article they are using shiftin and shift out but my compiler uses shiftright and shiftleft,why such a difference is needed.why am asking this is because they are using "sck" and i dont know what for they are using.as i mentioned above am new to this world(MPU), so i dont think you will laugh at me.
    IF YOU BORN POOR ITS NOT BECAUSE OF YOU BUT IF YOU DIE POOR ITS BECAUSE OF YOU.

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


    Did you find this post helpful? Yes | No

    Default

    Most of us here use this to compile
    http://store.melabs.com/prod/pbp.html
    I am not familiar with oshonsoft compiler. I did not notice that you were using that earlier.

    Basically you will have three pins on something like this.

    DATA
    CLOCK (SCK)
    LATCH or Chip Select
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    May 2010
    Location
    SINGAPORE
    Posts
    14


    Did you find this post helpful? Yes | No

    Thumbs up Thanks for your kind reply

    Quote Originally Posted by mackrackit View Post
    Most of us here use this to compile
    http://store.melabs.com/prod/pbp.html
    I am not familiar with oshonsoft compiler. I did not notice that you were using that earlier.

    Basically you will have three pins on something like this.

    DATA
    CLOCK (SCK)
    LATCH or Chip Select
    i now understood the use of "sck" that it is used to control the serial clk (pin) of the adc,but in the oshonsoft i cant find any command to do that.it simply got spicson and spicsoff to control the "cs" pin of the adc and no more to control the spi clk.please give me a good idea to do my project.As i mentioned above
    my project is to communicate the LTC2400 to a pic 16f690 and to display on a 16*2 lcd.The lcd portion working good.THANKS FOR NOW AND THANKS A LOT FOR YOUR FURTHER SUGGESTIONS.
    IF YOU BORN POOR ITS NOT BECAUSE OF YOU BUT IF YOU DIE POOR ITS BECAUSE OF YOU.

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


    Did you find this post helpful? Yes | No

    Default

    I would give the PBP demo a try if I were you
    http://melabs.com/pbpdemo.htm
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Because you are using the Oshonsoft compiler and "we" at this forum are using the MELABS PicBasicPro compiler (or PicBasicCompiler) - not the Oshonsoft BASIC compiler.

    You need to "translate" the any examples not written for your compiler so the instructions matches your compilers instruction set. BASIC is not known for being the most standardised programming language. Most i spretty similar in the basic command set like GOTO, GOSUB, FOR-NEXT, WHILE_WEND etc but when it comes to all the "special commands" like SPI, PWM, LCD, etc etc each compiler has it's own way of handling it. There simply is no standard for those type of commands.

    A quick look at the Oshonsoft site seems to indicate that what you are looking for is the [url=http://www.oshonsoft.com/picbasiccompilerreferencemanual.html#677] SPI Communication commands. Not ShiftLeft and ShiftRight - they are for shifting bits around in memory, not for shifting them in or out a pin.

    Don't worry about beeing new to this, we've all been there at one time or another. However, you may get better help with your project by posting on the forum dedicated for the compiler you are using. Good luck!

    /Henrik.

  9. #9
    Join Date
    May 2010
    Location
    SINGAPORE
    Posts
    14


    Did you find this post helpful? Yes | No

    Thumbs up Thanks for your kind reply

    Quote Originally Posted by HenrikOlsson View Post
    Because you are using the Oshonsoft compiler and "we" at this forum are using the MELABS PicBasicPro compiler (or PicBasicCompiler) - not the Oshonsoft BASIC compiler.

    You need to "translate" the any examples not written for your compiler so the instructions matches your compilers instruction set. BASIC is not known for being the most standardised programming language. Most i spretty similar in the basic command set like GOTO, GOSUB, FOR-NEXT, WHILE_WEND etc but when it comes to all the "special commands" like SPI, PWM, LCD, etc etc each compiler has it's own way of handling it. There simply is no standard for those type of commands.

    A quick look at the Oshonsoft site seems to indicate that what you are looking for is the [url=http://www.oshonsoft.com/picbasiccompilerreferencemanual.html#677] SPI Communication commands. Not ShiftLeft and ShiftRight - they are for shifting bits around in memory, not for shifting them in or out a pin.

    Don't worry about beeing new to this, we've all been there at one time or another. However, you may get better help with your project by posting on the forum dedicated for the compiler you are using. Good luck!

    /Henrik.
    Hai brother,
    for now i understood the differences among the instruction set on various compiler because of your reply and thanks for that.i want you to suggest me a compiler which will be better for future developments,because i think am still a wet clay and can be shaped.currently my project is communicating a pic16f690 to a external adc(LTC2400),I hope you will support me.THANKS A LOT FOR YOUR FURTHER SUGGESTIONS.
    IF YOU BORN POOR ITS NOT BECAUSE OF YOU BUT IF YOU DIE POOR ITS BECAUSE OF YOU.

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