As far as I know, they should work together.
Those don't look like MPASM error messages, are you sure you have MPASM selected as the assembler?
<br>
As far as I know, they should work together.
Those don't look like MPASM error messages, are you sure you have MPASM selected as the assembler?
<br>
DT
Yes, under "VIEW", Compile and Program Options, Assembler, a check mark in the Use MPASM box. As I said Darryl they work great on their own just not together. Probably operator error somewhere, I'm just not sure where.
Thanks for your help.
"It will never happen here!" just happened here.
My thoughts and prayers for Sandy Hook victims and families.
Can you post the code?
I'll take a look and see what's up.
<br>
DT
<code>
'************************************************* ***************
DEFINE LOADER_USED 1 ' If using bootloader
DEFINE OSC 20
DEFINE HSER_RCSTA 90h 'setup receive register
DEFINE HSER_TXSTA 20h 'setup transmit register
DEFINE HSER_BAUD 38400 'setup baud rate
INCLUDE "DT_INTS-18.inc" ' Base Interrupt System
INCLUDE "ReEnterPBP-18.inc" ' Include if using PBP interrupts
Addr var word
Char var byte
Clear
goto StartLoop ' Required
String1:
@ da "This is a string",0
AnotherString:
@ da "Here is another string",0
'------------GetAddress Macro - Location insensitive -------------------------
ASM
GetAddress macro Label, Wout ; Returns the Address of a Label as a Word
CHK?RP Wout
movlw low Label
movwf Wout
movlw High Label
movwf Wout + 1
endm
ENDASM
StartLoop ' This loop repeats continuously just as a test.
@ GetAddress _String1, _Addr ' Get address of String
gosub StringOut ' Send the String
hserout [13,10] ' New Line
@ GetAddress _AnotherString, _Addr ' Get address of String
gosub StringOut ' Send the String
hserout [13,10] ' New Line
pause 500
goto StartLoop ' Repeat
StringOut: ' Send the string out via Hserout
Readcode Addr, Char ' Get a character
if Char = 0 then StringDone ' Look for Null char, Stop if found
hserout [Char] ' Send char
Addr = Addr + 1 ' Point to next character
goto StringOut ' Continue with rest of the string
StringDone:
return
end
</code>
Here it is. Out for dinner for an hour or so. I'll check back later. Thanks again.
"It will never happen here!" just happened here.
My thoughts and prayers for Sandy Hook victims and families.
Ah, that helps.
You haven't defined the Interrupts yet.
There needs to be a section that looks something like this...That section should be at the top of the program (but after the INCLUDE files), and don't jump over it. It needs to actually execute.Code:ASM INT_LIST macro ; IntSource, Label, Type, ResetFlag? INT_Handler INT_INT, _ToggleLED1, PBP, yes endm INT_CREATE ; Creates the interrupt processor ENDASM @ INT_ENABLE INT_INT ; enable external (INT0) interrupts
Then there also needs to be a handler routine...HTH,Code:'---[INT - interrupt handler]--------------------------------------------------- ToggleLED1: TOGGLE LED1 @ INT_RETURN
DT
Here's the right one.
<code>
'************************************************* ***************
DEFINE LOADER_USED 1 ' If using bootloader
DEFINE OSC 20
DEFINE HSER_RCSTA 90h 'setup receive register
DEFINE HSER_TXSTA 20h 'setup transmit register
DEFINE HSER_BAUD 38400 'setup baud rate
'INCLUDE "DT_INTS-18.inc" ' Base Interrupt System
'INCLUDE "ReEnterPBP-18.inc" ' Include if using PBP interrupts
Addr var word
Char var byte
led1 var PORTC.0 'heartbeat LED
Clear
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _ToggleLED1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
T1CON = $31 ; Prescaler = 8, TMR1ON
@ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts
goto StartLoop ' Required
String1:
@ da "This is a string",0
AnotherString:
@ da "Here is another string",0
'------------GetAddress Macro - Location insensitive -------------------------
ASM
GetAddress macro Label, Wout ; Returns the Address of a Label as a Word
CHK?RP Wout
movlw low Label
movwf Wout
movlw High Label
movwf Wout + 1
endm
ENDASM
StartLoop ' This loop repeats continuously just as a test.
@ GetAddress _String1, _Addr ' Get address of String
gosub StringOut ' Send the String
hserout [13,10] ' New Line
@ GetAddress _AnotherString, _Addr ' Get address of String
gosub StringOut ' Send the String
hserout [13,10] ' New Line
pause 500
goto StartLoop ' Repeat
StringOut: ' Send the string out via Hserout
Readcode Addr, Char ' Get a character
if Char = 0 then StringDone ' Look for Null char, Stop if found
hserout [Char] ' Send char
Addr = Addr + 1 ' Point to next character
goto StringOut ' Continue with rest of the string
StringDone:
return
'---[INT - interrupt handler]---------------------------------------------------
ToggleLED1:
TOGGLE LED1
@ INT_RETURN
end
</code>
"It will never happen here!" just happened here.
My thoughts and prayers for Sandy Hook victims and families.
Oh, that helps even more.
There is a conflict between the two programs.
DT_INTS also has a GetAddress macro.
So you can just delete the GetAddress macro in the main program.
Don't forget to un-comment the include files.
<br>
DT
Bookmarks