Controlling OG-4 Decathron with PBP in an efficient way.


Closed Thread
Results 1 to 40 of 40

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,170


    Did you find this post helpful? Yes | No

    Default Re: Controlling OG-4 Decathron with PBP in an efficient way.

    It does not helps. And I'm not using MCLR pin for anything except programming. Tried TRISIO=%00101000 but that does not helps. Tried disabling MCLR from config, also no change. Making a pin input creates issues with others being output.

  2. #2
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: Controlling OG-4 Decathron with PBP in an efficient way.

    Did you try a new PIC? I've never seen what you're describing. Thinking something internal might be whacked.

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,728


    Did you find this post helpful? Yes | No

    Default Re: Controlling OG-4 Decathron with PBP in an efficient way.

    its a classic rmw problem.
    can also be caused by excessive load on output pin (capacitive or resitive) causing pin to not achieve proper logic level.
    Warning I'm not a teacher

  4. #4
    Join Date
    Feb 2013
    Posts
    1,170


    Did you find this post helpful? Yes | No

    Default Re: Controlling OG-4 Decathron with PBP in an efficient way.

    Yes tried new chip. Output pins are connected to MPSA42 transistor via 10K resistor.

  5. #5
    Join Date
    Feb 2013
    Posts
    1,170


    Did you find this post helpful? Yes | No

    Default Re: Controlling OG-4 Decathron with PBP in an efficient way.

    If I swap chip with 12F1840, will problem still exist?

  6. #6
    Join Date
    Feb 2013
    Posts
    1,170


    Did you find this post helpful? Yes | No

    Default Re: Controlling OG-4 Decathron with PBP in an efficient way.

    I decided to put it aside, to give my mind some rest, and back to DS3231.
    I found that it does not return seconds properly.

    Have two different example codes, they work fine for minutes and hours, but does not work for seconds - seconds increase like 02 04 08 10 12 14 16 till 28, then 29 and again increase in 2 and so on.

    Code:
    SecondsMSB=BCDSeconds & $70 
    SecondsMSB=SecondsMSB>>4              
    SecondsLSB=BCDSeconds & $0F              '
    Seconds=(SecondsMSB*10)+SecondsLSB 'combines DECMinutes MSB and LSB
    
    
    x=RTCSEC >> 4
    Y=RTCseC // 16
    z=X*10+Y

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,728


    Did you find this post helpful? Yes | No

    Default Re: Controlling OG-4 Decathron with PBP in an efficient way.

    If I swap chip with 12F1840, will problem still exist?
    more than likely , you need to understand and remedy the situation.

    http://www.picbasic.co.uk/forum/showthread.php?t=15843&highlight=shadow
    http://www.picbasic.co.uk/forum/showthread.php?t=15013&highlight=shadow

    a
    nd post your code and a schematic so we don't just keep guessing
    Warning I'm not a teacher

  8. #8
    Join Date
    Feb 2013
    Posts
    1,170


    Did you find this post helpful? Yes | No

    Default Re: Controlling OG-4 Decathron with PBP in an efficient way.

    Code is posted above.

    Schematic is simple, there are 4 MPSA42 transistors, each of which is connected via 10K resistor to corresponding ports (ZERO, ONE, TWO, TRE) as shown in code. GPIO.5 is tied via 10K resistor to VDD, and button pulls it to zero.

    Only addition to code above is

    Code:
    koka:
    
    if GPIO.5=0 THEN 'if pin pressed
    goto tavi 'launch rotation
    ENDIF
    pause 1
    GOTO KOKA

Similar Threads

  1. Subroutine or repeated code, which is more memory efficient?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th June 2014, 22:38
  2. large & efficient electro magnet
    By therian in forum Off Topic
    Replies: 13
    Last Post: - 19th October 2012, 06:53
  3. Making code more efficient, any ideas please?
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th July 2011, 13:28
  4. Efficient comparison on data (iButton)
    By enigma in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th August 2010, 13:37
  5. Is there a more efficient way?
    By markedwards in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th July 2005, 23:38

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