Ghange code from PIC16F877A to PIC16F88


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302

    Default Ghange code from PIC16F877A to PIC16F88

    I have the below code.
    I use pic16f877a and work fine. When i use the pic16f88 the code is not work.Why;
    Code:
    ' Define ADCIN parameters
        DEFINE  ADC_BITS        10     	' Set number of bits in result
        DEFINE  ADC_CLOCK       3     	' Set clock source (3=rc)
        DEFINE  ADC_SAMPLEUS    50    	' Set sampling time in uS
    
        adval   VAR WORD				' Create adval to store result
    
        ANSEL = %00000001           'this added for pic16f88   
        CMCON = 7                       ' Turn off the comparator
        ADCON0 = %11100001	            ' Configure and turn on A/D Module
        ADCON1 = %10000010              ' Port A is analog
        TRISA = %11111111		        ' Set PORTA to all input     	          	     
        
        INCLUDE "LCDbar_INC.bas"        ' Include the BARgraph routines
    	
    loop: 	
        ADCIN 0, adval					' Read channel 0 to adval (0-1023)
        adval = (adval */ 500)>>2		' equates to: (adval * 500)/1024
        
        LCDOut $fe,1 
        @         BARgraph  _adval,  1,   0,    16,   100,  lines
               
        PAUSE 200
    
        GoTo loop       				' Do it forever
    Last edited by savnik; - 12th March 2008 at 14:06.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    ADCON1 doesn't look right for the '88

  3. #3
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    ADCON1 doesn't look right for the '88
    I change the ADCON1 and now work.
    Thank you

Similar Threads

  1. Ghange code picbasic
    By savnik in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 21st June 2011, 16:16
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Replies: 8
    Last Post: - 7th December 2006, 15:42

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