first project, and yes, doesn`t work


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Bogdan, this code you wrote isn't too hot...

    blink_LED:

    PORTA.1 = 1
    PAUSE 1
    PORTA.1 = 0

    GOTO blink_LED

    You're turning your LED on for 1mS and then IMMEDIATELY turning it off again... so your eye will probably see your LED ON all the time, but certainly my eye can't catch a blink where the ON state is 1mS and the OFF state is a couple of uS.

    Correct that to something like...

    blink_LED:

    PORTA.1 = 1
    PAUSE 250
    PORTA.1 = 0
    PAUSE 250

    GOTO blink_LED

    Also, another mistake you made, you want PORTA.7 to be an INPUT, by stating PORTA=%00000000 you're forcing it to be an OUTPUT, delete that line.

  2. #2
    Join Date
    Apr 2009
    Location
    Boise, Id
    Posts
    44


    Did you find this post helpful? Yes | No

    Default

    Another thing I have a question on, you are using a 32khz crystal. I believe PBP defaults to 4 mhz unless something is Defined for OSC speed.

    DEFINE OSC 8

    for 8Mhz clock.

    Without that I don't know if PBP would know what to do?

    I don't know that 32 khz can be defined in PBP? Some one else that knows more than me might have some better input?

    Shane

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