12f675_fuse_about_to_blow!


Closed Thread
Results 1 to 40 of 929

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Cheers mackrackit, I was pretty close then-ish.

    I think I've got the whole sequence now:

    INTCON REG bit 3 set to 1 enables the INTCON REG flag bit 0. Bit 0 changes 'flags' when a button is pressed which is controlled by ( IOC = %00011000 - the buttons in effect)

    It was this line from the program that threw me:

    Code:
    INTCON.0 = 0    ' No buttons down, so clear int on change flag
    I originally thought that if no buttons were down then INTCON.0 = 0 so there was no flag to clear but on reading Bruce's:
    ' No buttons down, so clear int on change flag
    made me think it must be set to '1'.

    Thanks for the explanation.

    Dave
    Last edited by LEDave; - 14th November 2010 at 17:21.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Sometimes it is hard to say. From the data sheet.
    bit 0 GPIF: Port Change Interrupt Flag bit
    1 = When at least one of the GP5:GP0 pins changed state (must be cleared in software)
    0 = None of the GP5:GP0 pins have changed state
    If one of the two buttons were down and the other up when the bit was cleared,( made zero), then releasing one OR pushing the other will cause the flag to be set, (bit 0 = 1) , just looking for a change, any change.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Thanks for that mackrackit, I think I'm there now

    Just as an aside here, when I first started PIC programming in February I think it was, I never thought I'd ever figure out how any of the registers worked. I think I'm slowly getting there now though.

    So the last bit of program from the Main: section was:

    Code:
    ENDIF
        E_OUT=1          ' Enable transmitter (+ lights RFEN LED on demo board)
        PAUSEUS 25       ' Allow RF stage to stabilize
    Which is GPIO.5 RF transmitter enable output (SYMBOL E_OUT = GPIO.5).

    So the next part is the Encoding. I've got an idea on how this works (but not the full picture), I'll post up later.

    Dave
    Last edited by LEDave; - 14th November 2010 at 18:14.

  4. #4
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    I've just spent two hours working on a post which I'm not going to post for the minute.

    However Question:

    How does:
    Code:
    DAT_OUT.0[1]
    work? Or were do I look for the solution, is it in the manual? (I'd rather try and find the answer) if I can't I'll ask

    The whole piece of code is:
    Code:
    DAT_OUT.0[1]=~GPIO.3
    I think the
    Code:
    ~GPIO.3
    part simply sends to GPIO.3

    From the manual:

    If you don't want MicroCode Studio to interpret a control sequence, but rather send it as normal characters, then just use the tilda symbol (~) in front of the $ or # symbol. For example, letter ~#9712345 would be sent as letter #9712345.
    Have I got that bit right?

    Dave

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    (I'd rather try and find the answer) if I can't I'll ask
    COOL!!!

    "~" Look at the table under Math Operators 4.17 in the PBP manual.

    And these may help.
    http://www.picbasic.co.uk/forum/showthread.php?t=544
    http://www.picbasic.co.uk/forum/show...1955#post91955
    http://www.picbasic.co.uk/forum/show...&p=189#post189

    You may want to set up a little test program and send values to a LCD or something to play with this.
    Last edited by mackrackit; - 14th November 2010 at 23:07.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    You may want to set up a little test program and send values to a LCD or something to play with this.
    I will, the LCD's been looking a little lonely lately. I'll let you know how I get on.

    Cheers mackrackit, you're a star.

  7. #7
    Join Date
    Feb 2010
    Location
    I live in the UK
    Posts
    562


    Did you find this post helpful? Yes | No

    Default

    Code:
    ~ Bitwise NOT
    So it's a Bitwise NOT then (well I've never heard of that one before, I'll get straight on it)

    And not:

    If you don't want MicroCode Studio to interpret a control sequence, but rather send it as normal characters, then just use the tilda symbol (~) in front of the $ or # symbol. For example, letter ~#9712345 would be sent as letter #9712345.
    Like I thought it was. I can be almost dangerous with my assumptions sometimes

    Dave

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