Hi,
This is probably not the best project for a beginner and I don't have any way to test what I write but lets see if we can figure it out. If any one else sees this please feel free to jump in!
Can u pls explain why have u declared array (mystring var byte (16) of 16
Since I didn't know how many bytes the computer sends in the data-area and the spec-sheet you uploaded doesn't say I just took a number. You may need to adjust that to match.
1) Are you sure about the 2400baud? What about parity? 1 or 2 stopbits? The spec-sheet doesn't say....
2) You are running the PIC on its internal oscillator - this is usually not a good idea when using serial comms. I sugest you switch to a X-tal, atleast untill you have it working. Then you can try running on the internal oscillator.
3) Arrays are zero-indexed so if you have an array of 16bytes they are numbered 0-15.
Code:
x VAR Byte
cnt VAR Byte
r10Data VAR Byte[16]
'************** Array and LCD-test *******************
'This will fill the buffer with 65,66,67,68 etc which is ASCII for A,B,C,D etc
for cnt=0 to 15
r10Data[cnt] = cnt + 65
NEXT cnt
'Then run thru the array and display on the LCD - should read: ABCDEFGHIJKLMNOP
LCDOUT $FE,1 'Clear display
for cnt= 0 to 15
LCDOUT r10Data[cnt]
NEXT cnt
Pause 1000
'*****************************************************
loop:
HSERIN [WAIT($52,$E0), STR r10data\16\$FD]
LCDOUT $FE,1,"Data recieved" 'Show messege
PAUSE 1000 'Wait....
FOR cnt = 0 to 15
LCDOUT DEC r10data[cnt], " "
NEXT cnt
PAUSE 1000
GOTO LOOP
/Henrik Olsson
Bookmarks