Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PIC16F1455 working
#1 and attached. The code sets up the clock at 48MHz ready for USB usage and should also work on the 16F1454.  For use on the 16F1459 you will need to set ANSELB to zero in

A trivial change is needed to to change label for SPBRGL to SPBRG as below:

            ifndef USE_UART1
            ifndef USE_UART2
                error "No communication is specified"
        ifdef USE_UART1
            ifdef USE_UART2
                error "Both uarts are specified"
            #define PIRRCIF_        PIR1                ;uart interupt status register
            #define RCIF_            RCIF        
            ifdef TX1STA
                   #define TXSTA_        TX1STA                ;uart status
                   #define    RCSTA_        RC1STA                ;uart status
                   #define    SPBRG_        SP1BRGL                ;uart baudrate
                   #define    SPBRGH_        SP1BRGH                ;uart baudrate
                   #define    TXREG_        TX1REG                ;uart transmit
                   #define    RCREG_        RC1REG                ;uart receive
                   #define    BAUDCON_    BAUD1CON            ;uart receive
                   #define    TXSTA_        TXSTA                ;uart status
                   #define    RCSTA_        RCSTA                ;uart status
               #ifndef SPBRG
                       #define    SPBRG_        SPBRGL                ;uart baudrate
                       #define    SPBRG_        SPBRG                ;uart baudrate
                   #define    SPBRGH_        SPBRGH                ;uart baudrate
                   #define    TXREG_        TXREG                ;uart transmit
                   #define    RCREG_        RCREG                ;uart receive
                   ifdef BAUDCON
                       #define    BAUDCON_    BAUDCON            ;uart receive
                       #define    BAUDCON_    BAUDCTL                ;uart receive

Attached Files
.zip (Size: 4.77 KB / Downloads: 14)

Messages In This Thread
PIC16F1455 working - by matherp - 2016-08-26, 13:53:55

Forum Jump:

Users browsing this thread: 1 Guest(s)