HELP!! Pleas....PIC16F627a can't make usart receive interrupt work

Dec 15, 2006 1 Replies

Hi



Can someone take a peek at the code below and see if I have enabled the USART on the PIC16F627A correctly please.



All I want to do right now is set up a pic running @ 10MHz to 28800 baud and jump to my interrupt routine when it see a char. I can't make it happen. I have done this lots f times on other PICS but am getting nowhre in the 627A.



Please also see the lines reagrding TRISB - there is an errata for pic16f627a that mentions setting TRISB.



all help greatfully received - thanks


LIST p=16F627A #INCLUDE __CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _HS_OSC



ORG 0x000 goto START



ORG 0x004 goto SerialIRIRQ


START


call InitUart ; init uart baud rate etc.... bsf INTCON,GIE ; enable interrupts


MAIN


NOP NOP NOP NOP NOP goto MAIN



;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


InitUart ;Initialises the PIC UART for 28800 baud


;

I have not checked the entire code, but it jumps into my eye that you have not enabled the peripherial interrupt PEIE at register INTCON.

HTH Wolfgang

From-address is Spam trap Use: wolfgang (dot) mahringer (at) sbg (dot) at

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required