AT89C51 interfaced to emic module
Hello, every1. I'm currently involved in a project that involves the use of AT89C52, a member of the 8051 family of micrcontrollers, communicating with emic module. I've read the documentation and I've tried to reproduce the equivalent assembly code for 8051, but I'm yet to hear a sound. I heard absolutely nothing from the 8- ohms speaker. I need help. Attached is my code
Comments
The EMic itself is very simple and requires 2400 Baud serial input and output at TTL (+5V/0V) levels and an Busy TTL level signal line. You could even leave out the Busy line for test purposes. You could get a TTL to RS232 converter like a MAX232 and wire that up on a breadboard to convert the TTL level signals of the EMic to RS232, then connect that to a serial port on your PC for testing and experimentation. You could do the same sort of thing with your AT89C52 and use the PC to display the output of your program.
Once you get your AT89C52 to receive and transmit 2400 Baud data, then try again. We can help you with understanding how the EMic works, but not the AT89C52 coding.
Keep in mind that the EMic expects the serial data to be normal mode with the start bit at a logic low (0V) and the stop bit (and the idle state) to be logic high (+5V). Some microcontrollers might default to the opposite logic state.
Post Edited (Mike Green) : 9/14/2008 9:37:50 PM GMT
After connecting the emic module to the PC, what do I do next?
Do I set the module to receive ascii command sequence?
What terminal program will send signals to the emic module?
What form of flow control do I use for communication?
Thanks
Once you have the EMic connected to the PC, you simply run a terminal program like HyperTerm.
One free open source terminal emulator for Windows is Tera Term (ttssh2.sourceforge.jp/).
If you're just testing, you won't need flow control in that you'd type commands to the EMic and
the terminal emulator would display any responses. You'd probably use the Busy line for CTS if
you need to do handshaking and most terminal emulators would stop transmitting when CTS is
false (the EMic is busy).
I still have to face the task of making my AT89C51 micrcontroller communicate with the module.
An LM386 is a simple low power audio amplifier that can produce 300mW to 500mW.
Do a web search to find the datasheet and application notes. There are all sorts of
suggested designs floating around.
Attached is a schematic of the sound amplifier, I saw in the forum and it contains the 2nd schematic on page 17 of emic's documentation. Where do I connected Pin to? What form of signal is connected to Pin? What is the function. Thanks.
Pin is an I/O pin of a Stamp microcontroller or any other microcontroller that can produce a +5V logic level pulse train. A 3.3V logic level pulse train will produce a lower input volume level. The circuit shown there acts as a low-pass filter to round the edges of the square waves so that you get more of a pure tone at the frequency of the pulses.
If I have the basic description of how the Pin signal should be, I can write the program for AT89C51.
Thanks