Help with code


Closed Thread
Results 1 to 28 of 28

Thread: Help with code

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

  2. #2
    Join Date
    Jul 2007
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Is this better?

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xobx View Post
    Is this better?
    A bit...
    Still don't know which version of PBP, MCS+, or MPLAB you are using...
    Don't know which programmer and/or version of software/firmware...
    Don't know which config fuses are set (or at least you THINK are set)...

  4. #4
    Join Date
    Jul 2007
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Now then..

    And any help would be appreciate..

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by xobx View Post
    Now then..
    And any help would be appreciate..
    Ok, that's a fair bit better yet...
    Now then...What does the PBP manual say about oscillator selections?
    Also, do a readback of your 'config word' and match it up with the datasheet's explanations.
    What do you come up with?

  6. #6
    Join Date
    Jul 2007
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Ok, I read some and it seems like the Config is stored in '16F648A.INC', right?

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


    Did you find this post helpful? Yes | No

    Default

    try
    Code:
            @   __config _HS_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
            DEFINE OSC 20
            
    loop:   high portb.1
            pause 500
            low portb.1
            pause 500
            goto loop
            end
    Also, read the following thread, at least POST#1 and POST#5
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    if you're using PM, you will need to use
    Code:
            @   device  pic16F648A, hs_osc, wdt_on, mclr_on, lvp_off, protect_off
    instead of __CONFIG
    Steve

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

  8. #8
    Join Date
    Jul 2007
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    This worked!

    Code:
    @   device  pic16F648A, hs_osc, wdt_on, mclr_on, lvp_off, protect_off
            DEFINE OSC 20
            
    loop:   high portb.1
            pause 500
            low portb.1
            pause 500
            goto loop
            end
    Thank you!

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  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. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

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