16f886


Closed Thread
Results 1 to 13 of 13

Thread: 16f886

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    19


    Did you find this post helpful? Yes | No

    Thumbs up

    Got it working partially. Will work on it tomorrow.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Seems to work as design here using the following
    Code:
            
            @ DEVICE PIC16F886, INTOSCIO,WDT_OFF,MCLR_OFF,LVP_OFF,PROTECT_OFF,BOD_OFF,CPD_OFF,IESO_OFF,FCMEN_OFF,PWRT_OFF 'Device line
            OSCCON= %01100000
            
            Include "bs2defs.bas"
    
            DEFINE LCD_DREG PORTC 'LCD data port 
            DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4 
            DEFINE LCD_RSREG PORTC 'LCD register select port 
            DEFINE LCD_RSBIT 4 'LCD register select bit 
            DEFINE LCD_EREG PORTC 'LCD enable port 
            DEFINE LCD_EBIT 5 'LCD enable bit 
            DEFINE LCD_BITS 4 'LCD bus size 4 or 8 
            DEFINE LCD_LINES 2 'Number lines on LCD 
            DEFINE LCD_COMMANDUS 2000 'Command delay time in us 
            DEFINE LCD_DATAUS 50 'Data delay time in us 
    
            ANSEL=0
            ANSELH=0
            ADCON0=0
            CM1CON0=0
            CM2CON0=0
            VRCON = 0
            PORTA=0
            PORTB=0
            PORTC=0
            TRISA=0
            TRISB=0
            TRISC=0
            PAUSE 1000
                    
    start:
            
            lcdout $FE,1,"TEST THE LCD"
            
            lcdout $FE,$C0," TEST"
            PAUSE 1000
            high porta.2
            pause 500
            low porta.2
            pause 500
            high portb.5
            pause 500
            low portb.5
            lcdout $FE,1,"RESETTING"
            pulsout porta.5,1000
            pause 1000
            pulsout porta.5,1000
            pause 1000
            goto start
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2007
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Is CM1CON0=0 the same as CM1CON0.7 = 0?

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    well yes almost...mine is the lazy writer version and clear ALL register bits, while yours clear only bit 7... which is enough anyways.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 16f886
    By Larry in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th November 2008, 16:57
  2. 16f886 interrupt on portB problem
    By antonjan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th October 2008, 20:06
  3. 16F886 running out of SRAM ?
    By Chris Barron in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 29th August 2008, 23:01
  4. PIC Basic Pro Ver 2.47 Can't Do 16F886
    By NO2K in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th April 2008, 19:02
  5. Setting Fuses using Microcode Studio Plus
    By NO2K in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 18th May 2007, 23:14

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