Basic help for 12F629


Results 1 to 6 of 6

Threaded View

  1. #5
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Gene,

    I was looking at the PBC manual on the MElabs website. Here are some examples of setting the ports. You will also need to have a copy of the 12F629 datasheet to get the register information.

    Code:
    Symbol PortA = 5 'Define PortA register location 
    Symbol TrisA = $85  'Define PortA direction register location  
     Poke TrisA,0  'Make all PortA pins outputs 
     
     
     Peek PortA,B0  'Get current PortA pin states to variable B0  
     Bit1 = 1  'Set Bit1 in B0 which will become PortA pin 1 high  
     Bit3 = 0  'Set Bit3 in B0 which will become PortA pin 3 low  
      'Bit0, 2 and 4 will remain unchanged  
     Poke PortA,B0  'Send the new byte to PortA to complete the change
     
     End   
    
    5.23. POKE
    
    POKE Address, Value
    
    Writes Value to the PICmicro MCU register at the specified Address. Special PICmicro MCU features such as A/D converters and additional I/O ports may be written using POKE. POKE is a PICBASIC™ Compiler statement and is not supported on the BASIC Stamp. (See PEEK for more information.)
    
    Poke $85,0 'Write 0 to register hexadecimal 85 (Sets PortA to all outputs)
    I also just finished looking for some older examples of programs I wrote in PBC but they are at home on my older computer so I don't have access to them until this coming weekend.

    You need to look at the READ.ME file that came with your compiler program to check and see if the 12F629 will work with PBC. I didn't see it in the manual's list. You may be wasting your time with this chip if its not supported!

    HTH,

    BobK
    Last edited by BobK; - 22nd September 2009 at 01:53. Reason: Got more information

Similar Threads

  1. Sending Commands from Visual Basic about IR to Pic
    By tne_de in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th April 2009, 06:09
  2. Indexer not indexing...a basic PBP problem??
    By jellis00 in forum General
    Replies: 8
    Last Post: - 24th March 2009, 16:53
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Visual Basic 2005
    By keithdoxey in forum Off Topic
    Replies: 4
    Last Post: - 1st August 2007, 12:10
  5. vb6 to pic basic
    By Darrenmac in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th December 2005, 01:56

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts