Maker Pro
Maker Pro

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

S

sommes

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...
 
K

Ken Taylor

sommes said:
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...
Why are you so hung up on using the HT-12D/E pair? Is it just that they
are the first things you came across or are you *really* stuck with
using them/ It seems to me they are making your life unnecessarily
complicated. There are better modules around for your task, as has been
pointed out before.

Ken
 
S

sommes

Thank you ken.

Could you please sugguest me some "better modules" for transmitting three
message at the same time.

It is because HT-12E is 1 to 1 encoder and seem it is design to send more
than one message at the same time.

I really get stuck on HT-12E, but it is what my partner wants.

Thank you for your time.
 
T

The Real Andy

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...

You need to define yourself a simple protocol. For example,
<start snetinal><message length><message><crc><end sentinal>

Send the message 4 bits at a time, then use a software shit register
to reassemble the message. If the crc is wrong, discard the message.
If the message needs to be sent reliably, then you need some kind of
acknowledgement mechanism in your protocol, so a failed message can be
resent.
 
S

sommes

Thank Jasen.

Could you please explain some more detail about that method.

For example, 10 bits is "abcd efgh ij"

I send the first 4 bits as

"1abc" with 1 to tell reciever it is the start four bit

then

"defg"

then

"0hij " with 0 to tell reciever it is last four bit

repeat it to get other 10 bits

Am I on the right track?
 
T

The Real Andy

i answered this a few weeks ago. you have 10 bits to send

abcdefghjk

send 1abc
then defg
then 0hjk

then re-read your 10 bits and repeat....

when receiving

you'll get anonymous 4 bit symbols

wait till you get one starting with 0
then wait for one starting with 1

that's guaranteed to be an example of the first symbol.
and contains bits abc

the next contains cdef

and finally 0hjk

Bye.
Jasen

Comms 101. Always use error checking. An 8 bit crc adds virtually no
overhead, but provides increased reliability.
 
S

sommes

Thank Jasen

"personally I'd be looking for a way to connect the AVR's serial port
directly
to the transmitter and leave the encder out entirely."

Do you mean do the software encoding by AVR chip and output that encoded
data by serial port and connect to transmitter directly?
 
T

The Real Andy

Thanks Andy.

What is meaning of "Comms 101"?

It means this is the very basics, ie, the first subject you learn at
shcool.

It usually means you need to go read a book.
 
T

The Real Andy

I normally ignore typos, but "Shcool" is just too funny in the
context of your message. ;-)

One day i will use a spell checker!

When i try to compile code i often have to spend several hours
removing typos. MS make it easy these days with there 'intellisense',
i just need to find a decent newsreader that has the built in
autosmarts.
 
T

The Real Andy

I still use Netscape 4.78 to read newsgroups. it has a decent spell
checker, and if it doesn't recognize a word you can copy and paste it
into Google. If you get a "Do you mean" with an alternate spelling and
its right you can copy that back to your message. Run the spell checker
again and click on "Learn" so it will remember it for the next time.

Agent has a spell checker too, it just means I have to click the 'ABC'
button up the top. Word is smarter, it does the spell check for me and
underlines it in red. Perhaps i should give the new outlook 2003
newsreader a go, that is if 2003 has a newsreader built in.
 
D

Daniel

The said:
One day i will use a spell checker!

When i try to compile code i often have to spend several hours
removing typos. MS make it easy these days with there 'intellisense',
i just need to find a decent newsreader that has the built in
autosmarts.

and find a decent grammar checker as well. "there 'intellisense',"
should be "their 'intellisense'," or, maybe, that package will do both!
No, "there" is the correct spelling of a word, so probably will not
raise an error flag. Oh, well!

Daniel

*** ***
 
Top