Shop OBEX P1 Docs P2 Docs Learn Events
AT89C51 interfaced to emic module — Parallax Forums

AT89C51 interfaced to emic module

timextimex Posts: 21
edited 2008-09-19 08:55 in General Discussion
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

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-14 21:32
    We really can't help you with the AT89C52 code, particularly assembly code. This is a Parallax support forum and, while some people might just happen to have documentation on and experience with the AT89C52, most would not.

    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
  • timextimex Posts: 21
    edited 2008-09-15 06:34
    Thanks mike for the reply.

    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
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-15 14:12
    Again, you do need an RS232 to +5V serial converter like a MAX232 between the PC and the EMic.

    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).
  • timextimex Posts: 21
    edited 2008-09-16 14:27
    Thanks for the reply. Will a 0.4W speaker be ok for the design? Is the wattage rating of the speaker very important? THanks
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-16 15:22
    The wattage rating for the speaker tells you the maximum amount of power you can use without damaging the speaker. Usually it gives you a hint as to the size of the speaker and its sensitivity. You'd expect a 50W speaker to not produce very much sound if you provide 50mW of output power, but a 0.4W rated speaker would probably have reasonable sound levels with 50mW.
  • timextimex Posts: 21
    edited 2008-09-18 06:49
    Hello, thanks I've made progress connecting the emic module to the PC using hyperterminal. I heard sound this time. How can I make the sound louder than the emic module's maximum?

    I still have to face the task of making my AT89C51 micrcontroller communicate with the module.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-18 06:57
    For more volume, you will need an external amplifier of some sort.
    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.
  • timextimex Posts: 21
    edited 2008-09-18 08:54
    Alright, thank you, Mr Mike. You've been of great assistance. I'll update you on my progress
  • timextimex Posts: 21
    edited 2008-09-18 09:58
    I was looking at the emic module documentation on page 17 and kept wondering what FREQOUT and DTMFOUT are? Please explain

    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.
    864 x 280 - 58K
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-18 14:15
    FREQOUT and DTMFOUT are documented in the Basic Stamp Syntax and Reference Manual which you can download from Parallax. FREQOUT produces a sine wave of a user specified frequency or pair of frequencies and DTMFOUT produces a standard touch-tone pair of frequencies.

    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.
  • timextimex Posts: 21
    edited 2008-09-19 08:55
    Mr mike, I have downloaded the Basic Stamp syntax and reference manual. It's so difficult for me to comprehend. I can't simply understand it. I have built the EmicWIthAmp circuit. My difficulty is about Pin. What signal do I send to Pin so that I can achieve my aim of amplifying the emic's volume? What frequency?

    If I have the basic description of how the Pin signal should be, I can write the program for AT89C51.

    Thanks
Sign In or Register to comment.