IŽm trying to send data from PIC to BS2 via serout2 but the values are sistematically been altered.
The 12F675 is generating the sequence:
0,1,2,3,4,...,255
And the BS2 is receiving:
128,129,130,131, ... , 157,158,159,128, 129,130,...
I verified and OSCCAL was not erased.
Things got better when i include the line:
Define OSCCAL_1K 1
on the code, but the problem did not dissapear at all.
here are the codes:
12F675 code:
The BS2 code:Code:include "bs2defs.bas" Define OSCCAL_1K 1 ' Set OSCCAL for 1K Device ANSEL=%00000000 CMCON=%00000111 Trisio = %11111111 ' Set all ports as inputs Trisio.4 = 0 ' Set port GP4 as output saida CON 4 i var byte pause 1000 loop: for i = 0 to 255 serout2 saida,16780,[i] pause 100 next pause 2000 goto loop end
Seems to me that is some timing problem. I overnight on this problem without a solution. I must be missing something trivial, but I cant figure out what!Code:' {$STAMP BS2} ' {$PBASIC 2.5} entr PIN 1 entr_mode CON 16780 'entrada baudmode = 2400/8N1 INV PAUSE 10 p VAR Byte Start: SERIN entr,entr_mode,[p] DEBUG DEC p," " GOTO Inicio
IŽll appreciate any help


 
		
		 
						
					 
			 
			 
			 
					
					 serout out of order on 12F675
 serout out of order on 12F675
		 
 
		 
 
		 Same code worked on a 16F688
 Same code worked on a 16F688
		 Originally Posted by mister_e
 Originally Posted by mister_e
					


Bookmarks