Can't get a 16F88 to do anything.


Closed Thread
Results 1 to 15 of 15

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 ccowley,
    Welcome to The Forum, let's pretend, just for hoots, that you are a complete newbie, and we are the starving code hungry dogs,<b> I did say we are pretending didn't I ?</b> Throw us some bones of your startup code, maybe a little meat on those bones (a loop or 2 ), a little copy paste of what you have tried . . . and we'll see if you did something wrong, just so you don't have to edit the hex later
    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
    Aug 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Still not working...

    Hi again,

    Thanks to both of you for your input! I really appreciate the response, but things still aren't working. I did read through the entire thread that was linked to (among others) and tried everything that was suggested. The code snippit below is the from that thread and is the one I have been working with today. I have spent another 4 hours playing with this thing and it just isn't going.

    I have repeated the results with two different bread boards and two different power supplys and I have rotated through 4 diffent chips and get the same results. I have checked my power and ground connection also. I can't remember ever have this kind of trouble with a microcontroller (well, okay, there were a few hairy times back in wirewrap days in college with a certain 6502 chip).

    So, here is the code that I am using:

    OSCCON = %01101110 'set int osc to 4mhz
    'OSCON = %01100000
    ANSEL = 0 'ALL DIGITAL
    CMCON = 7 'COMPARATORS OFF

    TRISA = %00000000 'ALL OUTPUTS
    TRISB = %00000000 'ALL OUTPUTS
    PORTA = 0 'PORTA LOW

    @ DEVICE MCLR_OFF, INTRC_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF
    Pause 100 'SETTLE DOWN

    START:
    High PORTA.6 'ON LED
    High PORTA.7
    Pause 1000
    Low PORTA.6 'OFF LED
    Low PORTA.7
    Pause 1000
    GoTo START 'REPEAT FOREVER

    end

    I have also tried it with the edited INC file and unedited INC file as mentioned in the other thread, but it doesn't change anything.

    One odd note is that RB5 is always a constant 5V on every chip that I have tried so far (up to 4 now). I checked it with a scope to see if it was a clock signal or something, but it is a solid 5v.

    Thanks in advance!

    Carl

  3. #3
    Join Date
    Jun 2007
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Try this OSCCON

    Hi Carl,
    I usually use
    OSCCON = %01101000 and it seems to work. Don't forget the Define OSC for speeds other than 4MHz.
    Hope this helps.
    Mike

  4. #4
    Join Date
    Aug 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Trying OSCCON %01101000

    Hi Mike,

    Thanks for taking a look at it. I tried the OSCCON value that you suggested and it still didn't work. I am beginning to wonder if it must be a compiler error, but I'm sure I'm not the only one using these that is still on PBP 2.47. I ordered upgrade to PBP 2.50 today just in case, but I'm not conviced that's the answer.

    Thanks again,

    Carl

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


    Did you find this post helpful? Yes | No

    Default

    If you are using MPLAB then try this config
    Code:
    @__config _CONFIG1, _INTRC_IO & _WDT_ON & _LVP_OFF & _CP_OFF &_MCLR_OFF
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Aug 2008
    Posts
    7


    Did you find this post helpful? Yes | No

    Default MPLab

    Hi Dave,

    I only use MPLab for programming the chip it isn't used for anything else. The current fuses show up perfectly in MPLab when I import my code into it. If I change them, they change in MPLab with next import. I have also turned off the 'set from code' on import and set them manually, but still no luck.

    I suppose I could change MicroCode Studio's setup so that it used MPLabs assembler (I have used it that way before) instead of PBP's and then I could use the fuse settings that you listed. It might be worth a shot. I will check it on Monday.

    Either I am missing something really simple or this thing just isn't compiling/programming correctly as far as I can tell. My PICStartPlus programmer has the most current software upgrade too. Monday I'm going to try it all with a different computer and my other PICStartPlus programmer. I also order one of MicroEngineering Labs new programmers along with the PBP upgrade, so I'll see if that makes any difference. My current version of PBP is supposed to work with the F88 though, so I am at a loss.

    My current setup is working fine with the other PIC's I am programming and using in other projects, but I need some of the extras in the F88 for another project and I am just not getting anywhere with this bad boy.

    Thanks for the suggestions,

    Carl

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


    Did you find this post helpful? Yes | No

    Default

    try this using MPASM assembler:
    Code:
    OSCCON = %01101110 'set int osc to 4mhz
    OSCTUNE = 0   ' SET TO CENTER FREQ
    
    ANSEL  = 0 'ALL DIGITAL
    ADCON0 = 0
    ADCON1 = 0
    CMCON  = 7 'COMPARATORS OFF
    DEFINE OSC 4
    
    TRISA = %00000000 'ALL OUTPUTS
    TRISB = %00000000 'ALL OUTPUTS
    PORTA = 0 'PORTA LOW
    @ __config _CONFIG1, _INTRC_IO & _WDT_ON & _LVP_OFF & _CP_OFF &_MCLR_OFF
    ;@ DEVICE MCLR_OFF, INTRC_OSC, WDT_OFF, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF
    Pause 100 'SETTLE DOWN
    
    START:
    High PORTA.6 'ON LED
    High PORTA.7
    Pause 1000
    Low PORTA.6 'OFF LED
    Low PORTA.7
    Pause 1000
    GoTo START 'REPEAT FOREVER
    
    end
    or this for PM assembler
    Code:
    OSCCON = %01101110 'set int osc to 4mhz
    OSCTUNE = 0   ' SET TO CENTER FREQ
    
    ANSEL  = 0 'ALL DIGITAL
    ADCON0 = 0
    ADCON1 = 0
    CMCON  = 7 'COMPARATORS OFF
    DEFINE OSC 4
    
    TRISA = %00000000 'ALL OUTPUTS
    TRISB = %00000000 'ALL OUTPUTS
    PORTA = 0 'PORTA LOW
    ;@ __config _CONFIG1, _INTRC_IO & _WDT_ON & _LVP_OFF & _CP_OFF &_MCLR_OFF
    @ DEVICE MCLR_OFF, INTRC_OSC, WDT_OFF, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF
    Pause 100 'SETTLE DOWN
    
    START:
    High PORTA.6 'ON LED
    High PORTA.7
    Pause 1000
    Low PORTA.6 'OFF LED
    Low PORTA.7
    Pause 1000
    GoTo START 'REPEAT FOREVER
    
    end
    A genuine 2 bit blinky
    Last edited by Archangel; - 24th August 2008 at 09:31.
    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


    Did you find this post helpful? Yes | No

    Default

    i had 3 16f88's that no matter what i did, they would not run with internal osc. pop a crystal and 2 caps and not another problem since.

Similar Threads

  1. Code works on 16F84A but not on 16F88?
    By pharaohamps in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th November 2009, 19:29
  2. Output settings for 16F88
    By PICante in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 22nd June 2008, 15:03
  3. 16F88 RA6 and RA7 troubles
    By gandora in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 3rd August 2007, 03:57
  4. 16f88 help
    By ccsparky in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd July 2004, 18:50
  5. 4 line LCD with 16F88
    By anj in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 7th February 2004, 10:06

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