PDA

View Full Version : UArt question



smeet
- 26th April 2006, 04:01
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

Ioannis
- 26th April 2006, 07:49
Keep in mind that as long as UART is sending the characters, A/D will not work even if you are using the Hserout command.

To be sure that your converter is started at predetermined intervals, I guess the best approach would be Darrel Taylor's Instant Interrupts. That way you would be able to send one character, start A/D, send another character, if A/D is finished then Interrupt will make a notice to your code, etc.

Ioannis

smeet
- 27th April 2006, 01:21
hi thanks a lot... ill look into that... I had another question.. Do u recommend using Manchester coding for RF communication... My PIC output is connected to a transmitter at 418 Mhz ...

I need a range of around 300 feet..


Thanks

Ioannis
- 27th April 2006, 10:03
Yes, absolutely do use manchester encoding. This came up a number of times and you will find alot of answers if you do a search.

Ioannis

smeet
- 27th April 2006, 22:12
I am trying to use Hserout with manchester coding.. however I have this problem... DOes Hserout support 16 bits or do I need to specify IBIN16 before the variable...

I could not implement the Instant interrupts as I have never used them before and I need to submit my project by tom...

Any help from you will be appreciated thanks a lot

Ioannis
- 27th April 2006, 22:33
Hserout is 8-bit command.

If you want to send out 16-bit wide variable you have to send it like 2 bytes as

Hserout [mybyte.lowbyte, mybyte.highbyte]

or as an array. I think better is the first way.

All are in the manual of the compiler.

Ioannis