what on earth can I be doing wrong?


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2008
    Posts
    5

    Unhappy what on earth can I be doing wrong?

    Hi Everyone;

    Thanks for your thoughts in getting me started with my Epic Programmer. I believe Picmate was looking in the wrong directory for the Epic so I switched to Microcode Studio, use it to write a hex file and then open Epic to load the hexfile into my chip.
    I say BELIEVE, because the Pic still won't work.
    EPIC appears to program and verify the 16F876 chip....but when I transfer it to my breadboard --- NOTHING.
    I'm using a simple blink the LED program, listed here:


    symbol LED = 0 'Rename pin 0 of portb (PIC 16F876 pin 21) to LED

    TRISB = %00000000 'Setup port b as RB7-RB1 outputs, RB0 as output
    main: 'Label for beginning of main loop
    High LED 'Set pin 0 of portb high (5 volts) which turns the LED on
    pause 1000 'Pause 1000 milliseconds (1 second) with LED on
    Low LED 'Set pin 0 of portb low (0 volts) which turns the LED off
    pause 1000 'Pause for 1 second with LED off
    goto main ' Jump to the main label and do it again

    END

    I have quadrupled checked my connections on the breadboard with two different chips and I still get nothing. Tried two different crystals. Two different 5v sources. The logic probe indicates I've got 5v at all the correct places, and ground at all the right places, but the LED still won't blink ( yes I've tried reversing the leads. No dice)
    And strangely, my logic probe records a high on RC6. Which is strange since I don't think I've bothered with Port C in any way.
    Is there some configuration I haven't set? Is it possible the EPIC programmer only THINKS it's programmed the chip? Or have I found a brand new way to be confused?
    ANY THOUGHTS would be appreciated since I would really like to get on with building the strange lights to frighten the villagers.


    cheers

    MacQ

  2. #2
    Join Date
    Oct 2004
    Location
    North Norfolk UK
    Posts
    146


    Did you find this post helpful? Yes | No

    Default

    hi MacQ

    Super quick guess if it progs and verifies but wont run

    check your crystal/ resonator are you using internal RC?
    have you told the programmer what you are using? intosc xt hs etc etc

    sounds like it could just need an oscillator to clock against

    duncan

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Make it even simplier:
    Code:
    trisb = 0
    main:
    portb.0 = 1
    pause 500
    portb.0 = 0
    goto main
    No variables, no nothing to mess with anything...

    And strangely, my logic probe records a high on RC6. Which is strange since I don't think I've bothered with Port C in any way
    It's floating... All (ok, most) pins are set to input on RESET so they don't load down the external circuitry (well, that's one reason anyways). So, it's probably floating. I'd be willing to bet if you put a 'scope on it, grounded out the pin with a 1k resistor, it would go to 0v, then when the resistor was pulled away, it would rise 'slowly' back up to 5v.

    Or have I found a brand new way to be confused?
    Yep...you have...
    Do a search on config bits and presetting, etc. There's a bunch of threads on presetting config bits and clock settings, etc.
    Last edited by skimask; - 8th February 2008 at 20:19.

  4. #4
    Join Date
    Feb 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Default great suggestions, but...

    thanks skimask for offering the simpler code.

    I think you're probably right about the floating pin. Although, I connected a 1k resistor to it and gorund and the pin is still high. I don't have a scope to check though.
    I have checked the config settings and tried every option but RC. But no luck. Tomorrow I'll rewire it for RC and see if that makes any difference.

    And Duncan303, I think you're right too. The oscillator is almost certainly the problem. But as I say I've tried every configuration and nothing works. I have a smaller 16f876 pic that I will try in the morning.

    So frustrating. But thank you so much for trying to help

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dmacq View Post
    thanks skimask for offering the simpler code.
    I think you're probably right about the floating pin. Although, I connected a 1k resistor to it and gorund and the pin is still high. I don't have a scope to check though.
    I have checked the config settings and tried every option but RC. But no luck. Tomorrow I'll rewire it for RC and see if that makes any difference.
    And Duncan303, I think you're right too. The oscillator is almost certainly the problem. But as I say I've tried every configuration and nothing works. I have a smaller 16f876 pic that I will try in the morning.
    So frustrating. But thank you so much for trying to help
    Try a different spot in the breadboard, or a new breadboard.
    We've had more than a few discussions here in the past year or so about breadboards gone bad (I should make a video...I'd make million$ !!!)... contacts wearing out, dirty contacts, etc.

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by dmacq View Post
    ... I switched to Microcode Studio, use it to write a hex file and then open Epic to load the hexfile into my chip.
    I say BELIEVE, because the Pic still won't work.
    EPIC appears to program and verify the 16F876 chip....but when I transfer it to my breadboard --- NOTHING.

    And strangely, my logic probe records a high on RC6. Which is strange since I don't think I've bothered with Port C in any way.
    Which button in MicroCode Studio did you use to compile the program?

    Since the TX pin starts up as output high, it appears that you've compiled it for Debug mode (ICD Compile).
    The Pic will sit and do nothing until it connects to the MCS Debugger via RS-232.

    Use the buttons next to the Device select Drop-down box.
    "Compile Only" or "Compile and Program"

    hth,
    DT

  7. #7
    Join Date
    Feb 2008
    Posts
    5


    Did you find this post helpful? Yes | No

    Smile umm, oops

    Quote Originally Posted by Darrel Taylor View Post
    Which button in MicroCode Studio did you use to compile the program?
    Use the buttons next to the Device select Drop-down box.
    "Compile Only" or "Compile and Program"

    hth,
    Well, I'm somewhere north of humiliation and south of seppuku.
    After the hours I spent scrupulously examining the components, the power supply, the configurations and the hex files.... I was clicking the wrong button.
    Thank you Darrel for spotting the problem. The pic is happily blinking LEDs and even making music.
    And thank you ALL for your helpful suggestions.
    What a fabulous resource this is. I hope I can repay the favours and not make any more grotesque errors as I make my way through the learning curve.
    I have to say the feeling of exhilaration is way out of proportion to the final result: a blinking LED. But it's made my weekend.
    Thanks again.

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Put - The - Sword - Down!!!

    If you continue programming microcontrollers ...
    You will have MANY problems more deserving of seppuku.
    Don't do it over you're first Blinky program.

    There's 1 problem you won't have again.
    Only about a million more to find.

    Every one will be a "bitch".
    But like you've already found out, the feeling you get when it finally works, makes it all worthwhile.

    Happy PICing!
    DT

Similar Threads

  1. What am I doing wrong?
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th October 2009, 19:46
  2. WRITECODE stores wrong 14-bit word values in FlashMEM
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 26th June 2009, 04:35
  3. LCD Showes Some Wrong Letters
    By sbobowski in forum General
    Replies: 2
    Last Post: - 23rd September 2008, 19:15
  4. HSERIN/OUT Wrong
    By Kaldurenik in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th October 2007, 10:40
  5. ADCIN - AD settings are wrong
    By teverett in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th December 2006, 16:32

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