Startup power higher than while program running - why?


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Okay, I'll init it LOW

    Okay, I'll init it LOW.

    It was now clear to me.

    Checking this out now...

    You're right - now it works fine.

    Actually, I noticed that all PORTBs are driven HIGH for one second when I power-up the circuit. I initilize them to LOW but this happens after the register setting.

    I don't think it would make sense to set the PORTBs LOW before the registers are set, does it?
    Roger

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Try this

    Hi,

    Could you please insert the following lines in your register settings:

    Code:
    SSPCON.5   = 0                  ' DISABLE THE SYNC.SERIAL.PORT AND USE AS I/O
    TRISB      = %11000000
    PORTB      = 0                  ' Init PORTB to low
    Portb.5 is shared with the onboard Synchronous Serial Port. Turning off bit 5 of the SSPCON registers turns off this peripheral and configures it as general I/O.
    Regards

    Sougata

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Default register settings

    Sougata,

    I think my SSPCON register is already set but, just to make sure, am I right to say that in the PIC's datasheet, the register settings have default values I can read like here "R/W-0" and it would mean that the bit is set to 0?

    Code:
    REGISTER 10-2: SSPCON: SYNCHRONOUS SERIAL PORT CONTROL REGISTER (ADDRESS 14h)
    R/W-0 R/W-0 R/W-0   R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
    WCOL  SSPOV SSPEN(1)CKP   SSPM3 SSPM2 SSPM1 SSPM0
    bit 7                                       bit 0
    Roger

  4. #4
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default You are right

    Hi,

    The default when the PIC starts is SSPCON turned off. But you mentioned that your portb is keeping high for sometime from start. There has to be a logical reason why. I do not have a 16F88 lying so cannot give it a try myself. May be I should give a closer look to your code.
    Regards

    Sougata

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default

    Sougata,

    Thank you for confirmation.

    As said in a previous post, I have solved the problem by putting a 1µF cap in serie with the BUZZER.
    Roger

Similar Threads

  1. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  2. Pic getting part power from Analog Port
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 22nd April 2009, 10:34
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  4. Replies: 4
    Last Post: - 16th May 2008, 14:35
  5. Program returns to beginning at interupt
    By BGreen in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 25th April 2005, 11:20

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