pic16f886


Closed Thread
Results 1 to 6 of 6

Thread: pic16f886

  1. #1
    Join Date
    May 2010
    Posts
    21

    Default pic16f886

    hi,
    i would like to ask if anyone hv use pic16f886...i do have problem dealing with port A and B..is there any configuration that i need to for this 2 ports?
    thanks

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default

    Hi,
    I've never used it but that chip has analog functions (ADC and comparator inputs) across both PortA and PortB.... You're not saying what the problem you're having IS but a wild guess is you're not using them for analog inputs, yet you haven't configured them to be digital I/O's.

    See the ADC and comparator section in the datasheet.

    /Henrik.

  3. #3
    Join Date
    May 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Thumbs up pic16f886

    the problem is that when i connect a switch at port A&B it's not working....but when i connect the switch at port C it's OK....i'll the datasheet again...thanks for the info....

  4. #4
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default

    As Henrik pointed out, its most likely because you havent disabled the ADCs and the comparators. If you dont need them, perhaps the easiest way to do it in one stroke is to use DT's Alldigital.pbp as an include. Check this thread:

    http://www.picbasic.co.uk/forum/showthread.php?t=11100

    Should solve your problem.

    Regards,

    Anand

  5. #5
    Join Date
    May 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Smile

    tq for the idea....i would like to ask any of you to check my code...it seems like noting wrong but when the m=1 suppose that there is something display...but notting happens accept for OK that been send by XBEE....
    Code:
    @ DEVICE HS_OSC
    define OSC 20
    DEFINE HSER_BAUD 9600
    DEFINE HSER_TXSTA 24h
    DEFINE HSER_SPBRG 129
    ANSEL = 0          'All Digital, konfigurasi ini utk jadikan semua port
    ANSELH = 0          'digital utk high, low, serin/out, if.
    'DEFINE OSC 8
    'OSCCON = %01110001
    dta1 var word
    LED var PORTb.0
    m var PORTb.1
    bilangan var byte
    
    main1:low LED  
    if m = 1 then main
    serout2 portb.2, 16468,["SELAMAT DATANG KE CEDEC...:",34,13,26]
    pause 200
    goto main1
    
    main: high LED : pause 300
    hserout ["+++"]
    'hserout ["+"] Pause 50:hserout ["+"]Pause 50:hserout ["+"]
    hserin 2000,main1,[dta1(0),dta1(1)]
    
    'For bilangan = 0 to 2
        'HSerIn 2000,main1,[dta1(bilangan)]
    'Next bilangan
    'hserin 3000, main1,[wait("OK"),dta1]
    serout2 portb.2, 16468,[dta1(0), dta1(1)]
    pause 2000
    in : if m = 1 then main1
    hserout ["ATID 100"]: pause 50:hserout [26]
    'hserout ["ATID",26] : pause 200: hserout [26,13] ause 500
    'For bilangan = 0 to 2
    hserin 2000, in,[dta1(0),dta1(1),dta1(2)]:pause 200
    serout2 portb.2, 16468,[dec dta1(0),dec dta1(1),dec dta1(2)]
    low LED : Pause 200
    goto main1
    thanks

  6. #6
    Join Date
    May 2010
    Posts
    21


    Did you find this post helpful? Yes | No

    Post read at command from xbee using picbasic

    hi guys...
    as the above title clearly state...i would like to how to read AT command from XBEE using picbasic....thanks...

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