Problem with ports help plz


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Mus.Me,
    2 things,
    <b>first </b>Use Code Tags, Please.
    You do this by writing the word" code "in between square brackets[write it here ] before your code, and after your code you put /code again in between square brackets, like so [/code]
    <b>second</b> thing, what was the PIC you were having trouble with before?
    Look at these links:
    http://www.picbasic.co.uk/forum/showthread.php?t=11263
    http://www.picbasic.co.uk/forum/showthread.php?t=10834
    16F84 is a good fit for you right now, no extra distractions, "fighting with variables"? Oh, I see what you are saying . . .
    Last edited by Archangel; - 28th July 2009 at 04:05.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    May 2009
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    Code:
    thank u joe for help i will do it right this time lol
    Last edited by Mus.me; - 29th July 2009 at 05:07.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mus.me View Post
    Code:
    thank u joe for help i will do it right this time lol
    Great ! How's that code coming ?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Jul 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Question Weird port Problem

    I have a weird PORTA problem. I set PORTA Bit 7 to digital input. The pin is pulled up with a resistor to VCC. When I first start the PIC after programing and release from reset, PORTA Bit 7 is at logic low causing my PIC to enter a branch to clear EEPROM and STOP. When I start the PIC again the program behaves normally.



    DEFINE OSC 4 'Define the Osc to 8 MHz

    asm
    bsf OSCCON, SCS1 ; 1x = Internal Block
    bcf OSCCON, SCS0 ; 00 = Primary Oscillator (20Mhz?)
    bsf OSCCON, IRCF2 ; 111=8000 110=4000 101=2000
    bsf OSCCON, IRCF1 ; 100=1000 011=0500 010=0250
    bcf OSCCON, IRCF0 ; 001=0125 000=0032
    MSTABLE010 btfss OSCCON, IOFS
    bra MSTABLE010 ; wait until Oscillator is stable
    endasm
    data @0,0 'Initialize location 0 on eeprom to zero
    LED2 var PORTB.2 ' LED
    cntr var word
    FET var PORTA.0
    TRISA = %01000000 ' Set PORTA port 2 and 7 to input, 0, 3-6 ,8 Output
    TRISB = %00000000 ' Set PORTB to all output
    PORTB = %00000100 ' Clear PORTB, and set B2
    PORTA = %01000000 ' Clear PORTA
    led2 = 1
    read 0,cntr 'read location 0 or eeprom
    FET = 0
    if (PORTA.7 = 0) then
    pause 255
    If (PORTA.7 = 0) then
    write 0,0 'reset eeprom to 0 when port A Bit 7 has been forced to 0
    Stop
    else
    Endif
    else
    endif
    Main:
    led2 = 0
    pause 64
    led2 = 1
    if (cntr < 10) then
    Pause 255 'slow blink under ten cycles
    pause 255
    else
    Pause 64 'fast blink over 10 cycles
    endif
    cntr = cntr + 1 'increment cntr
    write 0,cntr 'write new cntr value into eeprom
    if (cntr <= 20) then goto main
    FET = 1 'Shut down RF Current
    ' cntr = 0
    stop
    goto main
    Stop

    End

    Though this is not a show ender it is bothersome.

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


    Did you find this post helpful? Yes | No

    Default

    A lot of PICs have analog on portA. If the one you are using shutting the ADC off may help.
    Go to the FAQ section and look for a thread about portA not working.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jul 2009
    Posts
    23


    Did you find this post helpful? Yes | No

    Default

    I disabled the A/D converter ADCON0 = 0, but the problem remains. Strange.

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


    Did you find this post helpful? Yes | No

    Default

    What PIC are you using?
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. sleep problem help plz >>>.
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 16th November 2009, 08:21
  2. Replies: 6
    Last Post: - 10th January 2008, 10:38
  3. ESC problem plz help
    By al000y in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st January 2007, 10:21
  4. Problem reading multiple ADC ports
    By jswayze in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2004, 16:46
  5. Problem with intensity.. plz help
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th October 2004, 17:25

Members who have read this thread : 1

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