Menu

DS1620 Temperature sensor

2007-03-23
2013-05-30
  • Nobody/Anonymous

    Hello!

    I want to use a DS1620 with my PIC16F876. I have been using the DS1620 with my Basic Stamp using PBasic's SHIFTIN and Shiftout command.
    These commands are not implemented yet in GCBasic and I read a post about using SPI instead. Can anyone tell me what the source code would look like to accomplish this. I am completly new to GCB and Micro controllers.
    Thanks in advance!

    Alex

     
    • Nobody/Anonymous

      Well I haven't used SPI yet myself, but you could bit-bang the commands out, and read the input back from the DS1620.

      You would substitute a subroutine for the shiftin or shiftout commands.  Several examples exist in the Contributor forum for writing and reading bytes in GCBasic.  Some GCBasic syntax.

      Set I/O lines like:
      #define Clck PortB.0  'Or whatever port and pins work for you
      #define Latch PortB.1
      #define DataLine PortB.2
      etc.

      Set direction of I/O lines like:
      Dir Clck Out
      Dir Latch Out

      Set Constants like:
      #define Rconfig 0xAC    'Protocol for DS1620 'Read Configuration'
      #define Wconfig 0x0C    'Protocol for DS1620 'Write Configuration'
      etc.

      Send out a command like:
      Set Latch Off
      Set Clck On
      Shftout(Wconfig)        'A sub to send out a byte to DS1620

      Regards,
      Kent
             

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.