you can use
@ INT_ENABLE RX_INT
and
@ INT_DISABLE RX_INT
you can use
@ INT_ENABLE RX_INT
and
@ INT_DISABLE RX_INT
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
ahhh thanks guys
fixed it toggling both
' CREN = 0
' SPEN = 0
I didn't bother with the interrupts just disabled the Port input thanks I appreciate it!!!
Hi Darrell, I tried to use your great rutines without any luck. I'm using a 18F248 sending CAN messages and I want to use a timer interrupt to send it.
Just to test the rutines I tried to compile the example you post for timer interrupt and DT_INTS-18.bas rutines. But I got some errors on the compilation. Attached you will find a screen shot of what i'm talking about. If anybody can tell me what I'm doing wrong, it will be a great help for me.
Thanks in advance for all yor help
Alfredo
Hi Alfredo,
Well apparently, not all CAN modules are the same.
There are 2 types, CAN and ECAN.
I didn't consider the plain CAN module when I wrote it.
I'll have to make a way for it to detect which module is available and only use the interrupts for it. Then I'll post an update.
But for now, you can just comment out the interrupt Sources that aren't available.
In the DT_INTS-18.bas file, comment out the following lines in the CAN Module section ...Thanks for the info!Code:asm ; -- CAN Module -- ifdef WAKIF ;----{ CAN bus Error }------------------------[PIR3, ERRIF]--- INT_Source CAN_ERR_INT, PIE3,ERRIE, IPR3,ERRIP ;----{ Invalid Received Message }-------------[PIR3, IRXIF]--- INT_Source CAN_IRX_INT, PIE3,IRXIE, IPR3,IRXIP ;----{ Receive Buffer 0 }------Mode 0--------[PIR3, RXB0IF]--- INT_Source CAN_RXB0_INT, PIE3,RXB0IE, IPR3,RXB0IP ;----{ FIFO Watermark }--------Mode 1, 2---[PIR3, FIFOWMIF]--- ; INT_Source CAN_FIFOWM_INT, PIE3,FIFOWMIE, IPR3,FIFOWMIP ;----{ Receive Buffer 1 }------Mode 0--------[PIR3, RXB1IF]--- INT_Source CAN_RXB1_INT, PIE3,RXB1IE, IPR3,RXB1IP ;----{ Any Receive Buffer }----Mode 1, 2-----[PIR3, RXBnIF]--- ; INT_Source CAN_RXBn_INT, PIE3,RXBnIE, IPR3,RXBnIP ;----{ Transmit Buffer 0 }-------------------[PIR3, TXB0IF]--- INT_Source CAN_TXB0_INT, PIE3,TXB0IE, IPR3,TXB0IP ;----{ Transmit Buffer 1 }-------------------[PIR3, TXB1IF]--- INT_Source CAN_TXB1_INT, PIE3,TXB1IE, IPR3,TXB1IP ;----{ Transmit Buffer 2 }-----Mode 0=-------[PIR3, TXB2IF]--- INT_Source CAN_TXB2_INT, PIE3,TXB2IE, IPR3,TXB2IP ;----{ Any Transmit Buffer }---Mode 1, 2-----[PIR3, TXBnIF]--- ; INT_Source CAN_TXBn_INT, PIE3,TXBnIE, IPR3,TXBnIP ;----{ CAN bus Activity Wake-up }-------------[PIR3, WAKIF]--- INT_Source CAN_WAKE_INT, PIE3,WAKIE, IPR3,WAKIP endif list endm list ENDASM
DT
WOOOOW!
Thank you very much for the info, now I can use your rutines!!! Your info fix my problem
Thanks again!!!
Alfredo
.Damn.. way to slow this time
my solution was..
From p18f8680.inc file...Code:asm RXBnIF=RXB1IF TXBnIF=TXB2IF FIFOWMIF=RXB0IF INT_LIST MACRO INT_Handler TMR1_INT, _ToggleLED1, PBP, yes endm INT_CREATE endasm
On another hand... seems odd...Code:;----- PIR3 Bits ----------------------------------------------------- RXB0IF EQU H'0000' RXB1IF EQU H'0001' TXB0IF EQU H'0002' TXB1IF EQU H'0003' TXB2IF EQU H'0004' ERRIF EQU H'0005' WAKIF EQU H'0006' IRXIF EQU H'0007' FIFOWMIF EQU H'0000' RXBnIF EQU H'0001' TXBnIF EQU H'0004'
Last edited by mister_e; - 30th May 2008 at 23:33.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Good one Steve. That would have worked too.
Since they're actually the same bit's, but with different Names depending on the mode, that might be an easy way for me to fix it. Maybe.
<br>
DT
But yeah... we know how Microchip work... hard to tell if it will always work... on all PIC
Worth a try!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Steve,
Do you know if the there is any difference in accuracy between using a xtal osc and the internal RC osc esp. in relation to timer interrupts?
Squib
Bookmarks