Which chip do i use?


Results 1 to 40 of 78

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    if you don't use any HSERIN/HSEROUT you use the second methode, unless you use the DEFINE method.

    this one work here
    Code:
            @   __CONFIG _HS_OSC & _LVP_OFF
            DEFINE OSC 20
            
            PORTB=0
            TRISB = %00000010
            RCSTA = $90 ' Enable serial port & continuous receive
            TXSTA = $24 ' Enable transmit, BRGH = 1
            SPBRG = 129 ' 9600 Baud @ 20MHz, 0.16%
                
            PIE1.5 = 1  ' Enable USART interrupt
            
    
    start:
            if PIR1.5 = 1 THEN  ' RCIF FULL?
                    PORTB.0=1
                    PAUSE 200
                    PORTB.0=0
                    WHILE PIR1.5 
                        TXREG=RCREG ' send it back to the pc
                                    ' utill USART buffer is empty
                        wend
                    
                    if RCSTA.1=1 THEN  ' ANY Overrun?
                        RCSTA.4=0      '  YES clear it
                        RCSTA.4=1      '
                        ENDIF
                        
                    endif
                    
            goto start
    just change DEFINE OSC, TXSTA and SPBRG to suite your requirement. Make sure you have a RS232 inverter (MAX232 or else) between your PC and your PIC.

    And YES the DEFINE's have to be in capital letter, unless it will never work.
    Last edited by mister_e; - 29th November 2007 at 14:24.
    Steve

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

Similar Threads

  1. Trouble with PIC16F88 (chip hangs up)
    By nobner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th January 2009, 09:23
  2. Camera with PIC chip
    By The Master in forum Off Topic
    Replies: 5
    Last Post: - 1st July 2008, 14:28
  3. More info on L4620 liquid sensor chip
    By Nicmus in forum Documentation
    Replies: 4
    Last Post: - 1st June 2008, 23:03
  4. TV Display Chip
    By zadok in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 17th April 2008, 22:17
  5. chip selection aid
    By PICMAN in forum General
    Replies: 4
    Last Post: - 21st February 2005, 18:33

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