Originally Posted by ChrisMicro
my e-mail address ( [email protected] ) thanks alot
Originally Posted by ChrisMicro
my e-mail address ( [email protected] ) thanks alot
Hi I am trying to send packets of data using HSErout instead of SErout......The reason being when I try to use serout .. my A/d conversion is not as responsive as in Hserout.
This is the code I am trying to use.. Pls tell me if this is the right approach or not...
hserout ["SYNC",B2] using UART and I have also tried software using
serout2 PORTB.6,T1200,["SYNC",B2]
here B2 stores the A/d results...
for serin :
the hardware code is
HSERIN 1,Main,[wait ("SYNC"),B0]
and software is SERIN2 PORTB.4,T1200,10,Main,[wait ("SYNC"),B0]
Pls reply as I need to get it done today thanks
Hi smeet
What chip are you using? I believe you are doing an a/d conversion and try to send the conversion.
How many bites are you trying to send at a time? you can put your bites in an array var. and then send it, if you let me have your Email then I can send you a sample or two and do you realy need to use the UART?
Here is a 20 bite array sample:
First define the array as folow:
L1 VAR BYTE[20]
SerOut PORTA.6,N1200,["A",L1[0],L1[1],L1[2],L1[3],L1[4],L1[5],L1[6],L1[7],L1[8],L1[9],L1[10],L1[11],L1[12],L1[13],L1[14],L1[15],L1[16],L1[17],L1[18],L1[19]]
SerIn PORTA.5,N1200,3000,label,["A"],L1[0],L1[1],L1[2],L1[3],L1[4],L1[5],L1[6],L1[7],L1[8],L1[9],L1[10],L1[11],L1[12],L1[13],L1[14],L1[15],L1[16],L1[17],L1[18],L1[19]
Last edited by ChrisMicro; - 27th April 2006 at 00:59.
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
I have shown Next Index and Return as commented.. They are not commented though...
Bookmarks