blinking lights.


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511

    Default blinking lights.

    Hello folks, after programming a chip, and failure, I am sure that my logic was ok....My wonderful Spectrum analyzer showed no computer movemet. So I broke down and make the simplest program:

    ANSEL=0
    CMCON=%00000111
    TRISIO=%00001000

    Loop:
    Low GPIO.2
    High GPIO.2
    goto Loop

    end

    Scoping it out, I still had 5 volts on all pins, with no pulsating DC on GPIO.2 pin.

    I tried the program, on another chip, and the same results.
    Can someone tell me what I am missing?

    Dwayne

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Like a car that needs three things to make it go (Fuel, Air and Spark) and then it's guaranteed to run if you provide those, a PIC similarlly needs three things to run - Volts, Clock and Reset.

    >> Scoping it out, I still had 5 volts on all pins

    I do hope that didn't include pin 8.

    1. Let's assume you've wired up the +5v and GND/0v properly otherwise were on a losing wicket before we start.

    2. That leaves us the next item - Clock. Have you programmed your PIC for Internal Oscillator? - otherwise you're going to have to provide a crystal, resonator or some other clock source.

    3. Finally Reset. unless you have programmed for internal MCLR then you will have to provide a RESET on GPIO.3.

    Bet you've forgot some or all of those. Again, read the PIC's Datasheet (section called "Special Features of the CPU") and ensure either your programmer is set to the appropriate defaults or you have provided the requisit defines within your program. You can download the "yankeedoodle" example code from the "Sound Command with 12-bit MCU's" thread in this section back in August 2003 to see how this is achieved within your program for a 12F675.

    BTW... unless you've put some pauses between the High and Low GPIO.2 they're going to be toggling around 1MHz so make sure your scope is set fast enough to catch it.

    Melanie

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Melanie,


    D>> Scoping it out, I still had 5 volts on all pins

    M>>I do hope that didn't include pin 8.

    <g>... Well... almost all pins <g>


    M>>
    1. Let's assume you've wired up the +5v and GND/0v properly otherwise were on a losing wicket before we start.

    2. That leaves us the next item - Clock. Have you programmed your PIC for Internal Oscillator? - otherwise you're going to have to provide a crystal, resonator or some other clock source.

    3. Finally Reset. unless you have programmed for internal MCLR then you will have to provide a RESET on GPIO.3.

    Bet you've forgot some or all of those.
    <<


    Well, yes and no. It seems that every time I load up a .hex program, in the assembler, it changes that GPIO.3 to reset. I switched it to input, and when I load up my Hex again, it switches it to Reset. I guess that is one of the things you have to live with...<g>. It took me a while to figure out this was happening.


    M>> You can download the "yankeedoodle" example code from the "Sound Command with 12-bit MCU's" thread in this section back in August 2003 to see how this is achieved within your program for a 12F675.<<

    I saw that. <g> But decided not to mess with it.

    M >>
    BTW... unless you've put some pauses between the High and Low GPIO.2 they're going to be toggling around 1MHz so make sure your scope is set fast enough to catch it.
    <<

    thanks<g>. I am using a Spectrum Analyzer... good to 1 Gig.


    I want to thank you and the others so very much for your help, patience and time. I got my project working, and am checking out a Patent on it as soon as I travel to KC this summer.

    I definitely enjoy the Flash Programming of this PIC chip...It is MUCH better than spending 20 min under a Ultra Violet Light trying to erase a Philips 750 EPROM. I probably saved 10 days on erasing alone <g> Let alone 1/4 the cost of the chip. (Though I still used a 750 in my project).

Similar Threads

  1. blinking problem with PIC16f887
    By larzazral in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th January 2010, 02:04
  2. blinking LED
    By kindows in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 31st July 2009, 16:08
  3. RGB Christmas Lights
    By JEC in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 13th January 2009, 18:44
  4. 7-segment display blinking problem?
    By serdar_ozcan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th March 2006, 14:43
  5. Blinking LCD with using loop
    By Jųan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 5th August 2005, 13:24

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