Menu

Poke Command

Help
2008-02-20
2013-05-30
  • Nobody/Anonymous

    Hello, I found some information about the POKE command:

      'This program will set all of the PORTB pins high
        POKE (6, 255)

    The previous POKE command will set all pins as high.
    Does anyone have more detailed information about the POKE command ?
    I want to set individual pins on PORTB as high or low.
    The goal is to output BCD data.

     
    • Nobody/Anonymous

      Please disregard my previous question, I have found the answer.
      After consultation with the data sheet for the 16F628A, I have
      found the address and bit information for PORTB. A decimal
      value of 255 in the command PEEK 6, 255 will make all ports high.
      A decimal value of 0 will make all ports low. Any other decimal
      value will produce a differant BCD pattern. Forgive my ignorance.
      I am an absolute beginner !

      Sean

       
    • Hugh Considine

      Hugh Considine - 2008-02-22

      In GCBASIC PORTA, PORTB, etc are all treated as normal variables. If you need to output a particular value on a port, you can do it like this:

      PORTB = 255

      or

      PORTB = b'00110101'

      This will run faster than the Poke command, and is easier to read. The Poke command is mainly intended for clearing large blocks of memory inside of some loop.

       

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.