You really don't want to be using the encoder/decoder. You'd do far better to drive the transmitter with a hardware or bit-banged UART data stream. As long as you: 1: send an approrpriate preamble 2: keep the balance between zeros and ones reasonable 3: don't send too many zeros or ones in a row (or you could consider using manchester coding) The far end should be able to decode it quite cleanly. Bob Ammerman RAm Systems ----- Original Message ----- From: "Fowler, Paul B." To: Sent: Wednesday, June 19, 2002 10:30 PM Subject: Re: [EE]: HT640 and HT648L encoder/decoder questions > A mistake in the information below. I said I could encode a byte every > .0053 seconds. > > That is wrong. It is .053 seconds. > > So, my baud rate over the encoder/decoder is still less than 151 Baud... > Not > very good, but better than 8 baud... I would like to get closer to 5000 > Baud. > > Fowler > > -----Original Message----- > From: Fowler, Paul B. [mailto:paul.fowler@UNISYS.COM] > Sent: Wednesday, June 19, 2002 10:18 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [EE]: HT640 and HT648L encoder/decoder questions > > > I finally got the source code: > > Here is the latest information. > > 1) I switched the resistors on the encoder and decoder to be 120k Ohms... > > 2) I changed the Pic assembler to just "pass through" the RS232 signal to > port B which controls my led. This permits me to be much more accurate with > telling people the speed of the encoder/decoder. > > On the lcd attached to the decoder the following holds (I use nibble > mode on the LCD): > > RB0 = unused > RB1 = RS > RB2 = RW > RB3 = Enable > RB4 = D4 > RB5 = D5 > RB6 = D6 > RB7 = D7 > > 3) The current rate at which the encoder/decoder works is that I send 8 > bits over a 1200 baud connection to the Pic then I have to wait .0053 > seconds before I can transmit again. This is, btw, a big improvement over > previous times. Still I want to get much closer to a 5000 baud speed which > the RF devices claim to support. > > 4) My original questions still stand: > > a) Is the 390K resistor appropriate to drive the ht640 or is this just a > demo chip for driving the RF device that can't really > take advantage of the device? The data sheet says this is somewhere around > 80KHz. (As a side note, the RF device operates at a frequency of 434 MHz - > Is there any correlation? Somewhere I read I should be able to get around > 5000 baud out of these devices which should be plenty to drive the LCD.) > > b) Why did Reynold Electronics pick 390K resistors? > > c) What questions should I be asking to try to troubleshoot this circuit? > > d) What experiments should I run to give me more information? > > e) A new question - I failed to mention my circuit board with the encoder > and pic > microcontroller is powered by a power supply I salvaged from an old 486. I > am > using the 5 volt wire and ground. (I don't have much money.) Could this > power > supply be a problem? > > I have historical e-mail conversations at the bottom after the assembler. > > The assembler follows: > > ;********************************************************************** > ; * > ; This is for the wband project. * > ; This program accepts input from an RS232 line and converts that to * > ; High and Low voltages on RB1->RB7 * > ; * > ;********************************************************************** > ; * > ; Filename: wband.asm * > ; Date: 6/1/2002 * > ; File Version: 0.1 * > ; * > ; Author: Fowler, Manish, Sangram * > ; * > ; * > ;********************************************************************** > ; * > ; Files required: p16f877.inc, wband.asm * > ; * > ; * > ; * > ;********************************************************************** > ; * > ; Notes: * > ; * > ; * > ; * > ; * > ;********************************************************************** > > > list p=16f877 ; list directive to define > processor > #include ; processor specific > variable definitions > > __CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _HS_OSC & > _WRT_ENABLE_ON & _LVP_OFF & _DEBUG_OFF & _CPD_OFF > > > > > ;***** VARIABLE DEFINITIONS > w_temp EQU 0x70 ; variable used for context > saving > status_temp EQU 0x71 ; variable used for context > saving > iSDelay EQU 0x72 ; used in shortdelay routine > iLDelay EQU 0x73 ; used in longdelay routine > > BANK0 Macro ; Set up for Bank 0 > bcf STATUS,RP0 > bcf STATUS,RP1 > endm > > BANK1 Macro ; Set up for Bank 1 > bsf STATUS,RP0 > bcf STATUS,RP1 > endm > > BANK2 Macro ; Set up for Bank 2 > bcf STATUS,RP0 > bsf STATUS,RP1 > endm > > BANK3 Macro > bsf STATUS,RP0 ; Set up for Bank 3 > bsf STATUS,RP1 > endm > > > > > ;********************************************************************** > ORG 0x000 ; processor reset vector > clrf PCLATH ; ensure page bits are cleared > goto main ; go to beginning of program > > > ORG 0x004 ; interrupt vector location > movwf w_temp ; save off current W register > contents > movf STATUS,w ; move status register into W > register > movwf status_temp ; save off contents of STATUS > register > > > ; isr code can go here or be located as a call subroutine elsewhere > > > movf status_temp,w ; retrieve copy of STATUS register > movwf STATUS ; restore pre-isr STATUS register > contents > swapf w_temp,f > swapf w_temp,w ; restore pre-isr W register > contents > retfie ; return from interrupt > > ; > ; This delays for approx 769/5 milliseconds > ; > shortdelay movlw 0xFF > movwf iSDelay ; set iSDelay = 255 > decfsz iSDelay, F > goto $ - 1 > retlw 0 > > ; > ; Delay for approx 785149/5 milliseconds > ; > longdelay movlw 0xFF > movwf iLDelay ; set iSDelay = 255 > call shortdelay > decfsz iLDelay, F > goto $ - 2 > retlw 0 > > main > > BANK0 > clrf PORTA ; Set everything low > clrf PORTB > clrf PORTD > clrf PORTE > > BANK1 > > movlw 0x06 ; Set Port A to be Digital > movwf ADCON1 ^ 0x080 > > clrf TRISA ^ 0x080 ; Set everything as output > clrf TRISB ^ 0x080 > clrf TRISD ^ 0x080 > clrf TRISE ^ 0x080 > > movlw (1 << TXEN) ; Enable Serial Transmission > movwf TXSTA ^ 0x080 > movlw 0xFF ; Baud rate of 1200bps at 20MHz > oscillator > movwf SPBRG ^ 0x080 > > call longdelay ; Give the LCD time to initialize > > BANK0 > > movlw OPTION_REG ; get address of option register > movwf FSR ; put option register in FSR for > indirect access > clrf TMR0 ; reset the timer > > movlw (1 << SPEN) | (1 << CREN) ; Enable Serial IO > for Receive > movwf RCSTA > > Loop ; Loop Here - my serial IO is the > centerpiece > btfss PIR1, RCIF ; Wait for Received Character Set > goto Loop > movf RCREG, w ; Get the Received Character > movwf TXREG ; Send the Character back to RS232 > as an echo check > movwf PORTB ; Send the Character to the LCD > bcf PIR1, RCIF ; Clear the Character Present Flag > goto Loop > > END ; directive 'end of program' > > > History: > > Hi, > > I am a hobbyist... Sorry > > I am trying to set up a circuit for an RF control of an LCD. In setting up > the circuit I discovered that I could only send about a byte a second over > the RF link. On removing the RF transmitter and RF receiver and attaching > the encoder HT640 straight to the decoder HT648L I discovered the problem is > not the RF devices, but the speed at which data is being encoded and > decoded. > > History: > > 1) The circuit is driven by a PIC16F877... I can vary the delay between > changes to the pins on the decoder from a single "nop" statement to a loop > of about a second. > 2) I do have a led tied to the valid transmission output of the decoder. > 3) For debugging purposes, I have tied my transmit enable on the encoder to > Vcc as long as the circuit has power. > 4) Also, my LCD works when the transmission works. (About 8 baud.) > 5) My resistors are 390K between OSC1 and OSC2. > 6) The circuit is driven off of a 5v breadboard. > 7) Here is the datasheet for the encoder: > http://www.rentron.com/Files/ht-640.pdf > 8) Here is the datasheet for the decoder: > http://www.rentron.com/Files/ht-648l.pdf > 9) I recognize it would help if I sent the Pic program, but it is on a > dedicated pc for pic development that is not yet tied to the network. > > Given that I do not have fancy equipment and given that I set up the circuit > as described by the documents on Reynold's web site. Specifically: > http://www.rentron.com/remote_control/txlc-434.pdf > > Here are my questions: > > 1) Is the 390K resistor appropriate to drive the ht640 at more than about 8 > baud or is this just a demo chip for driving the RF device that can't really > take advantage of the device? The data sheet says this is somewhere around > 80KHz. (As a side note, the RF device operates at a frequency of 434 MHz - > Is there any correlation? Somewhere I read I should be able to get around > 5000 baud out of these devices which should be plenty to drive the LCD.) > > 2) Why did Reynold Electronics pick 390K resistors? > > 3) What questions should I be asking to try to troubleshoot this circuit? > > 4) What experiments should I run to give me more information? > > Any help is appreciated. > > My gut instinct is that this is either: > > a) "timing" issue between the PIC and the encoder. (since the timing > between the pic and encoder doesn't alter the speed of what the > encoder/decoder actually does, I doubt this is the problem.) > > b) resistor issue on the encoder and decoder. > > c) encoder/decoder issue where they just aren't fast enough (This may be > it... If I take 80kHz and divide by 33 as shown in the picture on the > datasheet and then by 12 I get 202 bits per second. If there are 3 words > that get continuously sent between the encoder and decoder, I may have > somewhere around 8 baud.... I don't know, I am just a hobbyist. Why would > Reynolds suggest using the HT640 if it cannot fully drive the RF devices? > Doesn't make any sense.) > > Again, any help... > > Thank you, > Fowler > > >Is there a good reason you're not using the hardware UART built into the > >16F877? I also don't understand how you "discovered" that the speed was > >about 8 baud when your code produces that timing. Is there any reason you > >can't set the transmitter and receiver to 300, 1200, or higher baud? I > >assume these are basic AM transmitter/receivers where the carrier is keyed > >on and off by the incoming signal? If so, note that this type of system > >need to send a preamble so that the receiver can sense and adjust to the > two > >carrier levels. > > I can see how that would be confusing... > > The UART is being used to receive RS232 from my PC. > > In the end, I would like a circuit that receives a signal from my PC, sends > it out over the RF devices, and drives an LCD. > > I put close to a 1 second loop in my program between changes on the pins on > the encoder. Anything much less than that and the encoder doesn't send the > information to the decoder (not all of it at least. If I cut the time I > wait in half, then it sends about every other change....) > > Again, if I take the RF device out, and directly attach the encoder to the > decoder, it is the same thing.... > > The RF devices as an FYI are Linx TXM-433-LC-R and Linx RXM-433-LC-S. > > By the Way, Thank you for even reading the previous e-mail... I will > attempt to get the Pic Code later today for any interested party. > Fowler > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body