|
|
View previous topic :: View next topic |
Author |
Message |
young
Joined: 24 Jun 2004 Posts: 285
|
how to use the ht-640 ht-648l decoder and encoder |
Posted: Tue Feb 01, 2005 7:47 am |
|
|
I am trying to add HT-640 encoder and HT-648Ldecoder to my RWS-TWS434, How they are working, and how to use the data and address pins? |
|
|
young
Joined: 24 Jun 2004 Posts: 285
|
|
Posted: Tue Feb 01, 2005 8:17 am |
|
|
I found out how data pins are used? how about the address pins? |
|
|
Guest
|
|
Posted: Wed Feb 02, 2005 12:14 pm |
|
|
I am trying to using a PIC port to send data threough encoder and receive from the decoder, currently, I am doing well by connecting each directly to the encoder data pins correspondingly, for example, if I send out one of the pin from pic to data0 pin of encoder uisng output_high, the receiver will got the data correctly, I check all 8 pins and they are doing well, how ever, when I am send data using from multiple pins, they are not working correctly, how can i correctly the problem?
the following is the code:
Code: |
#if defined(__PCM__)
#include <16F76.h>
#include <stdio.h>
#include <stdlib.h>
#fuses HS,NOWDT,NOPROTECT,NOBROWNOUT
//#device ADC=10
#use delay(clock=10000000)
#use rs232(baud=2400, parity=N, xmit=PIN_C6, rcv=PIN_C7)
int8 length,i,data1;
char data[40];
void main()
{
SET_TRIS_b(0x00);
SETUP_ADC_PORTS(NO_ANALOGS);
disable_interrupts(INT_EXT);
enable_interrupts(INT_RDA);
ENABLE_INTERRUPTS(GLOBAL);
while(1)
{
output_high(PIN_B0);
}
}
|
but if I do something like blink or multiple output, they may or may not work for a couple circles, and they keeps at a status, not change any more,
has idea about this, I think it might be the problem between pic and encoder, how can I fix it? |
|
|
Guest
|
|
Posted: Wed Feb 02, 2005 1:39 pm |
|
|
I found the problem is because I setup int_rda; if I disable interrupt it, data will work fine, however in this project I really need the interrupt. in fact, I am going to send data in the interrupt routine. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Feb 02, 2005 2:21 pm |
|
|
You should not enable an interrupt if you don't have the handler for it. You will just constantly get interrupted over and over because the flag never gets cleared.
Also, you don't send data using the RDA int. It is for receiving data. Use the transmit interrupt instead. |
|
|
Guest
|
|
Posted: Thu Feb 03, 2005 7:28 am |
|
|
Hi mark:
I enableed int_rda, because I am using it to receive data from a serial rs232 port (this port continuously send data). how can I use the transmitte interrupt, would you give me an example?
what is the encoder and decoder transimitting rate, I tried my project, I found in byte/200ms is good, could not go any further, it is too slow I think. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|