Can't get a 16F88 to do anything.


Results 1 to 15 of 15

Threaded View

  1. #9
    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.

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