HT-12E with AVR problem. I really need help.

Apr 27, 2006 2 Replies

I need to send 0-999 from one microcontroller to other microcontroller by HT-12E and HT-12D.



There are 8 address bits + 4 data bits in HT-12E. I would to like to ask, How can I send 0-999 with these 4 data bits and received by other microcontroller?



In the testing, I could send 1 digit successfully. For example, 9, which is



1001, then put 1001 to data bits 0-3 of HT-12E. It is becuase there is an address to tell when to start and stop.


1) How can I use data bit 0 of HT-12E to send first digit, bit 1 to send second digit and bit 2 to send third digit?


2) How can I send data which is more than 4 bit with HT-12E?

For example, I want to send 8 bit data which is 1001 0111, the HT-12E will encode like 8 address bits + 1001 then 8 address bits + 0111, so how can I put 1001 0111 back together?



P.S. I am using Atmel AT90S8535 with Bascom-AVR complier



Thank you for help...


is

Cut up your data in 4-bit chunks and send them one by one. If you do not know the number of 4-bit chunks in advance send a fixed size length header first. Or something like this. Make sure you send each nibble only once (keep your TE-pulse short). If you keep to your format you can reverse it at the receiver and voila.

--DF

Deefoo scrobe on the papyrus:

The 8 address bits in the HT12E do not need to be fixed. Why not use the LSB address bits as a nibble address. Scan in the receiver by changing the appropriate address bits and whenever the VT pin goes high you will know that you have a valid reception of that particular nibble. Use one of the non-BCD nibble values as an end-of-message flag. Start scanning in the receiver from nibble 0 and stop when you find the EOM value. That way the message can be as long as you need.

John B

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required