Hi ,
i am using PIC 16F877A... Ill attach my code hre... Im basically trying to send my A/d bits using a 418 Mhz transmitter... If I do not use HEROUt it really slows down my code as I am not using interrupts... I have not used interrupts bfore and need to get this code working in a day.. I d really appreciate your help... Im attaching my transmission and reception code here... Im trying Manchester encoding here and then transmit those 16 bits... I understand that I can send only 8 bits at a time so do u suggest I serout 2 array byte and serin two at the other end... I noticed you have added N1200 instead of T1200... CAn i use T1200..
My email is [email protected]
Part of the Code for serout :
A: Pause 5
If ADCON0.2 = 1 Then A
B0 = ADRESH>>4
B0=B0<<4
ADRESH = 0
' PORTD=B0
ADCON0 = %00111001
Pause 5
ADCON0.2 = 1
B: pause 5
if ADCON0.2 = 1 Then B
B1 = ADRESH >> 4
ByteIn = B0+B1
PORTD = ByteIn
GOSUB Encode
'hserout [B2]
hserout ["A",Manch] // I guess I went wrong here... Can I split Manch as 2 bytes c0 and c1 and use Hserout
'serout2 PORTB.6,N1200,["A",B2]
PAUSE 5
GOTO Main
Encode:
for Index = 0 to 7
if ByteIn.0[Index] = 0 then
Manch.0[Index*2] = 0
Manch.0[Index*2+1] = 1
else
Manch.0[Index*2] = 1
Manch.0[Index*2+1] = 0
endif
next Index
For Index = 0 to 7
Manch.0[(Index*2)] = ~ByteIn.0[Index]
Manch.0[(Index*2)+1] = ByteIn.0[Index]
'Next Index
'Return
Bookmarks