Slow starting up


Closed Thread
Results 1 to 35 of 35

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747

    Default Slow starting up

    hello,

    Not sure when I should put this...
    I have a program working 100% on the breadboard.
    I made a prototype board (soldering) , use the same chip and put in the socket of the prototype board. guess what.. its takes about 8 to 40 seconds to get running and showing values on the LCD..
    ..sometimes it will show only half the LCD screen for a couple of seconds then will show all what is suppose to show.
    First, it should take just 1 second to show the info on the LCD
    Second, like I said its the same chip.. put it back on the breadboard and it works.... Same value 10k MCLR,

    Anybody had this issue before ???
    I 'd rather it not be working instead of this...

    K
    Last edited by lerameur; - 9th May 2013 at 04:34.

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    I will post the code, because I think that might be issue here... I used another PIC from a previous project and its working ..
    Code:
    INCLUDE "modedefs.bas" 'Includes supoprt for PicBasic language
    
    OSCCON = %01100000 '4 Mhz
    DEFINE OSC 4
      
    CMCON = 7 : ADCON1 = 7
    DEFINE LCD_DREG PORTB ' Set LCD Data port
    DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTA ' Set LCD Register Select port
    DEFINE LCD_RSBIT 2 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTA ' Set LCD Enable port
    DEFINE LCD_EBIT 3 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    DEFINE LCD_DATAUS 250
    DEFINE CHAR_PACING 2000
    pause 1500
    
    
    ' Define ADCIN parameters
    Define ADC_BITS 10 ' Set number of bits in result
    Define ADC_CLOCK 3 ' Set clock source (3=rc)
    Define ADC_SAMPLEUS 50 ' Set sampling time in uS
    
    DEFINE CCP1_REG PORTB 
    DEFINE CCP1_BIT 0 
    ANSEL = %00000010 ' set   AN1  as analog, others to digital
    
    ADCON1 = %10000010 ' Set PORTA analog for ten bit ADC
    'ADCON0 = %00000001 ' Configure and turn on A/D Module
    
    TRISB = %01000010
    TRISA = %00000111
    
    DutyCycle var word
    Frequency  var word
    
    Mainloop:
    
    ADCON0.2 = 1			'Start Conversion
    pause 20	
    ADCIN 0, DutyCycle 'Read channel PORTA.0 Duty Cycle
    ADCIN 1, Frequency 'Read channel PORTA.1 Frequency
     Frequency = Frequency + 245
     DutyCycle = DutyCycle/4
     
    lcdout $FE,1, "DutyCycle: ", dec DutyCycle
    lcdout $FE,$C0, "Frequency: ", dec Frequency
    pause 100
    
    HPWM 1,DutyCycle,Frequency 'channel, dutycycle, frequency
    pause 20
    
    goto Mainloop
    
    END

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


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Solder-less breadboards have a ton of capacitance, between traces, probably need some on the crystal to get reliable OSC start . . . also add caps to LCD power pins. If you're using a resonator use HS not XT in your configs?
    Last edited by Archangel; - 9th May 2013 at 09:42.
    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
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    I have a 1uF cap, and using 4mhz internal clocking.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,651


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    may preset the outputs levels ...

    and explicitly write the chip config ...
    Last edited by Acetronics2; - 9th May 2013 at 20:36.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    I have an earlier version of that program, ( and no I changed it since) and that version work, meaning does not have this problem.
    I guess something is wrong with the code..

    K

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


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    Hi Ken,
    Let's have a look at your config statements please . . . Are you using internal osc on the breadboard too?
    Sometimes if PICs power up too slowly they flounder a bit before starting, also backfeeds make for strange behavior. . .
    Last edited by Archangel; - 14th May 2013 at 06:41.
    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.

  8. #8
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    According to the PBP3 manual LCDOUT command: "A program should wait for up to half a second before sending the first command to
    an LCD. It can take quite a while for an LCD to start up". I don't see the wait time in your code.

    Is it possible to have full code, schematic and some part numbers of major components?

  9. #9
    Join Date
    Dec 2012
    Location
    Tennessee
    Posts
    262


    Did you find this post helpful? Yes | No

    Default Re: Slow starting up

    I had a issue with time using a 16F877 chip the first time, I tried setting it to internal OSC in the fuse section of my programmer software, Apparently i did something wrong because it took about 1 minute for my lcd to come on, and even though my longest pause was 1 second, the fastest updates on my lcd were about 30 seconds, talk about problems with adc and such, I gave up on it at the time and havent used a 877 since. Im sure its something simple, if your using a external crystal make sure its got good connections to board, if its shorted or open perhaps the chip is changing to internal osc to prevent damage? not sure logically as long as your board is wired identical to the breadboard connections there is no logical reason it should not fuction the same... with the exception of capacitance, resistance, and inductance inherant in using jumper wires and mechanical connections. this is not usually a problem on breadboards. likely your problem would be in reverse, it works on PCB but not on breadboard if that was the issue.
    Perhaps, based on what you have other than your PIC, perhaps leave the PIC off the PCB and check continuity on buttons, diodes, etc.

    and dont forget to take a break or work on some other PIC project for a bit. Sometimes I get into bulldozer mode when I have a problem, 12 hours later im fruserated and tired and its still not working... but a break or playing with some other code makes me relax a bit and sometimes the fix just comes when your not trying so hard.

    when I design PCB's it helps sometimes to print it out and the schematic and compare and mark off parts and connections, see if your missing something or have something in the wrong location.

    Hope you figure it out.
    Last edited by wdmagic; - 11th May 2013 at 05:21.
    Chris


    Any man who has accomplished anything in electronics at one time or another has said... " STOP! WAIT! NOOO! Dangit.... Oh Well, Time to start over..."

Similar Threads

  1. My project is starting
    By cncmachineguy in forum General
    Replies: 91
    Last Post: - 15th February 2011, 01:56
  2. Starting with PIC18F
    By Gérard in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th May 2006, 16:40
  3. Starting PC from PIC
    By Tissy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 25th February 2006, 14:42
  4. Help starting a 876A
    By Naslund in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th March 2005, 09:25
  5. Help for someone just starting
    By Ed Cannady in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 30th March 2003, 11:17

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