Sign in

username:

password:



Not a member?

Search piclist



Search tips

Subscribe to piclist



piclist by Keywords

12F675 | 16F628 | 16F84 | 16f877 | 16F877A | 16F88 | 18F458 | ADC | AVR | Bootloader | CAN | CCS | CRC | EAGLE | EEPROM | ICD | ICSP | IDE | JDM | LED | Macros | Microchip | MPLAB | PCB-CAD | PIC10F | Pic12f675 | PIC16F84 | PIC16F84A | PIC16F877 | PIC18 | PIC18F452 | PicBasic | PICC | PICSTART | PWM | RS-485 | RS232 | SMT | SPI | UART | USART | USB | Wireless | Wisp628 | Xilinx

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | Piclist | Wireless USART

A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.

Wireless USART - "d.fektv" - Nov 28 11:04:46 2007

Hi guys,

I am trying to send 1 byte data packets from one 18f458 to another
using 433.93MHz FSK TX/RX devices. I am also using a manchester
encoder/decoder on both ends (DPC-9600) at 9.6kbps.

I am using WriteUSART() and ReadUSART() functions in asynch mode at
9.6kbps to send and receive the data.

The DPC-9600 simply interfaces the USART pins and the TX/RX devices.
In TX mode, the data sheet says to just send the output of the TX
USART pin to the 'Data In' pin of the DPC-9600 when you wish to
transmit.

In RX, when the DPC-9600 has received a byte of data, a 'Data Ready'
pin goes active low, and signals an input to the pic that there is
data in its buffer. The host (pic) responds by sending a logic 1 to
the 'Send Data' pin of the DPC-9600 and the buffer is emptied into
the RX reg of the USART.

Problem: Whatever value I send from the TX pic, I receive zero at
the RX pic, i.e 0x00.

At first I though that I might have been declaring the data to be
sent as 'int' (2 bytes) resulting in 0x00 in the RX reg for any value
below 256, since it holds only 1 byte. But not the case. My values
are less than 256 and they are 'unsigned chars'.

I appologise for the extent of my question, but I figure you better
know some background.

USART configuration at both ends:

OpenUSART(USART_TX_INT_OFF & USART_RX_INT_OFF & USART_ASYNCH_MODE &
USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_HIGH, 64);

Sample code for RX:
---
while(1)
{
if(DataReady == 0) //Input flag from DPC
{
SendData = 1; //output from pic to DPC
Delay1KTCYx(20); //allow time for DPC to empty buffer at 9.6kbps
x = ReadUSART();
SendData = 0;
Print(x); //a simple function to display x.
}
}
---
Sample code for TX:
---
unsigned char x = 1;
unsigned char y = 2;

while(1)
{
WriteUSART(x);
Delay10KTCYx(100); //allow 10ms in between transmissions
WriteUSART(y);
Delay10KTCYx(100);
}
---
Some help would be much appreciated

Thanks in advance

Nick (d.fektv)

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions



(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )