It is just as easy as using SERIN/SEROUT
I don't know what speed your chips are running - but.
Use MisterE's PIC Multi-Calc to help you set up the proper DEFINES
Then use something like the following:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Code:CR CON 13 LF CON 10 DataStatus = 0 INTCON.7 = 1 INTCON.6 = 1 INCLUDE "DT_INTS-18.bas" ; Base Interrupt System INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler RX1_INT, _GetChar, PBP, yes endm INT_CREATE ENDASM ;---------------------------------------------------------------------------- goto OverISRs: ;------------------------------------------------------------------------------------ GetChar: HSEROUT[CR,LF,"At least some data received"] ; THIS IS JUST FOR DEBUG!!! REMOVE IN ACTUAL PGM. HSERIN 15,BadData,[wait ("P"),UnitID2,TotalRate1.lowbyte,TotalRate1.Highbyte,TotalRate2.lowbyte,TotalRate2.Highbyte,_ TotalRate3.lowbyte,TotalRate3.Highbyte,TotalRate4.lowbyte,TotalRate4.Highbyte,OFI1,OFI2,OFI3,OFI4] DataStatus = 1 GOTO GoodData BadData: DataStatus.7 = 1 GoodData: @ INT_ENABLE RX1_INT @ INT_RETURN ;------------------------------------------------- OverISRs: MAIN: If DataStatus.0 then HSEROUT [CR,LF,#UnitID2,#TotalRate1," ............................. endif if DataStatus.7 then HSEROUT [CR,LF,"Data Error!"] DataStatus = 0 goto main
I haven't actually tested this but it should work.




Bookmarks