cancel
Showing results for 
Search instead for 
Did you mean: 

HDLC

huashilong
Associate II
Posted on September 25, 2006 at 01:46

HDLC

7 REPLIES 7
huashilong
Associate II
Posted on September 15, 2006 at 00:26

Dear Hich

I'm in hurry to implement RF unit with FM0/NRZI encoding, so l'm anxious to know the HDLC limitations. Can you give me some information about the HDLC limitations? thank you very much,

Regards,

lisihua2000@tom.com

hichem2
Associate II
Posted on September 18, 2006 at 12:03

Hi,

Could you please tell me what kind of limitations can cause you o lot of worry.

With regards,

Hich

huashilong
Associate II
Posted on September 19, 2006 at 00:58

I know that REN and TEN bits are swapped on readback. I have got over the limitation in my program. My program can work well with NRZ/NRZI encoding now, but it can't work with FM0/MANCH encoding. I'm not sure the mistake is took by me or str71x. Could you please help me? thank you very much!

here is the code :

//=============================================================================

#define CODE_NRZ 0

#define CODE_NRZI 1

#define CODE_FM0 2

#define CODE_MANCH 3

void HDLC_Init(unsigned char tx_code,unsigned int tx_bps,unsigned char rx_code,unsigned int rx_bps)

{

HDLC->GA1 = 0;

HDLC->GA0 = 0;

HDLC->GAM1 = 0;

HDLC->GAM0 = 0;

HDLC->PRES = 0;

HDLC->POSS = 0;

HDLC->TCTL = 0;

HDLC->RCTL = 0;

HDLC->BRR = 0;

HDLC->PRSR = 0;

HDLC->TFBCR = 0;

HDLC->RFBCR = 0;

HDLC->PCR = 0;

HDLC->ISR = 0;

HDLC->IMR = 0;

HDLC->PARH = 0;

HDLC->PAMH = 0;

HDLC->PARL = 0x00AA;

HDLC->PAML = 0x00FF;

GPIO_Config (GPIO1, 0x2000, GPIO_IN_TRI_CMOS);

GPIO_Config (GPIO1, 0x4000, GPIO_IN_TRI_CMOS);

GPIO_Config (GPIO1, 0x8000, GPIO_AF_PP);

if((tx_code==CODE_NRZ)||(tx_code==CODE_NRZI))

{

HDLC->TCTL = (((unsigned short)1)<

HDLC->BRR = ((RCCU_FrequencyValue(RCCU_FCLK)/tx_bps-1) & 0x0FFF);

}

else //((tx_code==CODE_FM0)||(tx_code==CODE_MANCH)

{

HDLC->TCTL = (((unsigned short)1)<

HDLC->BRR = ((RCCU_FrequencyValue(RCCU_FCLK)/tx_bps/2-1) & 0x0FFF);

}

if((rx_code==CODE_NRZ)||(rx_code==CODE_NRZI))

{

HDLC->RCTL = (((unsigned short)1)<

HDLC->PRSR = ((RCCU_FrequencyValue(RCCU_FCLK)/rx_bps-1) & 0x00FF);

}

else //((tx_code==CODE_FM0)||(tx_code==CODE_MANCH))

{

HDLC->RCTL = (((unsigned short)1)<

HDLC->PRSR = ((RCCU_FrequencyValue(RCCU_FCLK)/rx_bps/2-1) & 0x00FF);

}

}

yahoo1
Associate II
Posted on September 21, 2006 at 17:08

Hi,

I received an offical answer for ST to the same question. I have attached this draft document. I'm worry to use the HDLC unit for my application whitch is possible similar to your. But in any case I will use STR7.

Kind Regards

Ioannis

huashilong
Associate II
Posted on September 22, 2006 at 06:30

Dear elcom,

Thank you very much for your reply, I can't find the document you attached. Could you please attach it again or email to me?

thank you very much

Kind Regards

huashilong

yahoo1
Associate II
Posted on September 24, 2006 at 14:17

Sorry, hope it is working now.

Kind Regards

Ioannis

________________

Attachments :

STR71x-HDLC-Errata.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtFM&d=%2Fa%2F0X0000000aKi%2FFBZz7EOJOgMxEAPJBf02nDiWAl_RIzqLZFV85D8x4I8&asPdf=false
huashilong
Associate II
Posted on September 25, 2006 at 01:46

Dear elcom,

My application is for DSRC, I have to change my design now. You save my time equal to save my life. Thank you very much.

Kind Regards

huashilong