Looking thru the ASM generated by PBP, I could not find anything related to the PCLATH. Here is what I have working with the Help of MELabs of course (Thanks Mr. Leo!):
If that's the case, simply remove that section, and it should work much better.
HTH,
Darrel
I am using MPasm to assemble the PBP code. The only thing I see related to the inerupt in the ASM is here:Code:Adcon1 = 6 'disable analog comparator TRISA = %11111111 'Set Port A to inputs pir1.5 = 0 ' clearing interrupt flags Mess Var Byte '____________________Main_____________________ Start: PicRecieve: If PIR1.5 = 1 then Pic_serin Goto PicRecieve Pic_serin: Hserin [Mess] IncomingM: If Mess= %00000001 Then mess1 If mess= %00000010 Then mess2
<div class="smallfont" style="margin-bottom:2px">Code=</div>
<pre class="alt2" style="margin:0px; padding:6px; border:1px inset; width:600px; height:225px; overflow:auto">PicBasic Pro Compiler 2.45a, (c) 1998, 2004 microEngineering Labs, Inc. All Rights Reserved.
_USED EQU 1
INCLUDE "C:\PBP\16F870.INC"
; Define statements.
#define CODE_SIZE 2
#define LCD_DREG PORTB
#define LCD_DBIT 0
#define LCD_RSREG PORTB
#define LCD_RSBIT 4
#define LCD_EREG PORTB
#define LCD_EBIT 5
RAM_START EQU 00020h
RAM_END EQU 000BFh
RAM_BANKS EQU 00002h
BANK0_START EQU 00020h
BANK0_END EQU 0007Fh
BANK1_START EQU 000A0h
BANK1_END EQU 000BFh
EEPROM_START EQU 02100h
EEPROM_END EQU 0213Fh
R0 EQU RAM_START + 000h
R1 EQU RAM_START + 002h
R2 EQU RAM_START + 004h
R3 EQU RAM_START + 006h
R4 EQU RAM_START + 008h
R5 EQU RAM_START + 00Ah
R6 EQU RAM_START + 00Ch
R7 EQU RAM_START + 00Eh
R8 EQU RAM_START + 010h
FLAGS EQU RAM_START + 012h
GOP EQU RAM_START + 013h
RM1 EQU RAM_START + 014h
RM2 EQU RAM_START + 015h
RR1 EQU RAM_START + 016h
RR2 EQU RAM_START + 017h
_Mess EQU RAM_START + 018h
_PORTL EQU PORTB
_PORTH EQU PORTC
_TRISL EQU TRISB
_TRISH EQU TRISC
#define _PIR1_5 PIR1, 005h
INCLUDE "R2_PIC.MAC"
INCLUDE "C:\PBP\PBPPIC14.LIB"
MOVE?CB 006h, ADCON1
MOVE?CB 0FFh, TRISA
MOVE?CT 000h, _PIR1_5
LABEL?L _Start
LABEL?L _PicRecieve
CMPEQ?TCL _PIR1_5, 001h, _Pic_serin
GOTO?L _PicRecieve
LABEL?L _Pic_serin
HSERIN?B _Mess
LABEL?L _IncomingM
CMPEQ?BCL _Mess, 001h, _mess1
CMPEQ?BCL _Mess, 002h, _mess2
LABEL?L _mess1
PAUSE?C 001F4h
LCDOUT?C 0FEh
LCDOUT?C 001h
LCDOUT?C 048h
LCDOUT?C 065h
LCDOUT?C 06Ch
LCDOUT?C 06Ch
LCDOUT?C 06Fh
PAUSE?C 005DCh
LCDOUT?C 0FEh
LCDOUT?C 001h
RETURN?
LABEL?L _mess2
PAUSE?C 001F4h
LCDOUT?C 0FEh
LCDOUT?C 001h
LCDOUT?C 047h
LCDOUT?C 06Fh
LCDOUT?C 06Fh
LCDOUT?C 064h
LCDOUT?C 062h
LCDOUT?C 079h
LCDOUT?C 065h
PAUSE?C 005DCh
LCDOUT?C 0FEh
LCDOUT?C 001h
RETURN?
END?
END</div></pre>
How long a cable do you think I can get away with? I am trying to evolving this into a paging system (functional learning project) and was thinking of using 100' of Telephone wire. Too far? Or would it be better to use a twisted pair like the Cat5 wire?
Thanks Darrel
ChadMan




Bookmarks