First Day and need Help!


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    timmoore47's Avatar
    timmoore47 Guest

    Default First Day and need Help!

    Just getting started but unfamiliar with this Micro Code Studio environment.

    I get an error message about not supporting 16F877 on a sample program.

    Well I want to program 16F628A and 16F84A Pics, so how do I do that?

    Normally I'd start with

    Device 16F628
    Dim A, B
    Define PortA %00000000
    etc etc

    but what do I need to get this off the ground?

    A puzzled,

    TIM

    PS Any really noddy tutorials around?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If the 16F877 is on the drop list it must work.

    remove your config fuse to see. If there's any other problem, tell us your PBP version, Microcode Studio version and also post your code here.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    timmoore47's Avatar
    timmoore47 Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    If the 16F877 is on the drop list it must work.

    remove your config fuse to see. If there's any other problem, tell us your PBP version, Microcode Studio version and also post your code here.
    Err... I don't know where the drop list is. THe version of Micro Code Studio is v 2.2.1.1

    The Read.me file says this:-
    PICBASIC(TM) Compiler Ver. 1.45 README.TXT
    Copyright 2005 microEngineering Labs, Inc.

    I don't know if it's integrated correctly Into PIC BASIC Standard.

    The code is one of the Samples:-


    ' Simulate BS2 Shiftin and Shiftout

    Symbol DDIR = Dir0 ' Shift data pin direction is Dir0
    Symbol DPIN = Pin0 ' Shift data pin is 0
    Symbol CPIN = 1 ' Shift clock pin is 1

    Symbol I = B2 ' Loop counter


    ' Shift in some data
    Low CPIN ' Start shift clock low

    Gosub shiftin ' Shift in some data

    ' Shift out some data
    Low CPIN ' Start shift clock low

    B0 = 100 ' Data to shift out
    Gosub shiftout ' Go do it

    End


    ' Subroutine to synchronously shift in one byte
    shiftin: DDIR = 0 ' Set data pin direction to input

    For I = 1 to 8 ' 8 bits to a byte
    B0 = B0 * 2 ' Shift result 1 bit to the left
    Toggle CPIN ' Toggle shift clock
    Bit0 = DPIN ' Move data into LSB
    Toggle CPIN ' Toggle shift clock once more
    Next I ' Loop

    Return ' Go back to caller


    ' Subroutine to synchronously shift out one byte
    shiftout: DDIR = 1 ' Set data pin direction to output

    For I = 1 to 8 ' 8 bits to a byte
    DPIN = Bit0 ' Data out is LSB
    Toggle CPIN ' Toggle shift clock
    B0 = B0 / 2 ' Shift byte 1 bit to the right
    Toggle CPIN ' Toggle shift clock once more
    Next I ' Loop

    Return
    Last edited by timmoore47; - 18th May 2006 at 14:48.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Drop list <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=872&stc=1&d=1147960259 ">

    Now with PBC... iiiish i'm sorry i couldn't be much help but i believe that...
    Code:
    Symbol DDIR = Dir0 ' Shift data pin direction is Dir0
    Symbol DPIN = Pin0 ' Shift data pin is 0
    Symbol CPIN = 1 ' Shift clock pin is 1
    
    Symbol I = B2 ' Loop counter
    Is invalid. I know you must use or redefine specific variable name.. about the PORTA, PORTB.. name it's sure you can't use Dir0, Pin0 and 1

    Fortunately, there's some user here who use PBC and can help.
    Attached Images Attached Images  
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    timmoore47's Avatar
    timmoore47 Guest


    Did you find this post helpful? Yes | No

    Default

    Ok, Has anyone got a very simple code fragment I could try?

    So far I've not got off ground zero!

    Maybe I've got a duff install?



    Tim

  6. #6
    mramos's Avatar
    mramos Guest


    Did you find this post helpful? Yes | No

    Default

    I have a few, what type program are you after. I have one that runs two servos, to move my robot dog (PWM commands to servos). It is old and I would have to clean it up.

    I have one that reads and LDR and buzzes a Piezo buzzer every 30 seconds.

    What are you tryig to do?

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