A time and temperature talking device project


Results 1 to 6 of 6

Threaded View

  1. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Since this forum is for PicBasic, here's a simple test routine to check out the EMIC module.
    Code:
    DEFINE OSC 20
    
    ' -----[ I/O Definitions ]---------------------------
    
    Tx    VAR PORTC.0   ' wire to EMIC sin pin
    Busy  VAR PORTC.2   ' wire to EMIC busy pin
    Rst   VAR PORTC.1   ' wire to EMIC reset pin
    
    ' -----[ Constants ]---------------------------------
    
    BAUD            CON     0  ' T2400
    Yes             CON     1
    
    ' -----[ Initialization ]----------------------------
      TRISC = %000010100
      
    Setup:
      GOSUB Hard_Reset                 ' restore defaults
      PAUSE 1000
      SEROUT TX, Baud, ["volume=7;"]   ' max volume
      GOSUB Check_Busy
      SEROUT TX, Baud, ["pitch=1;"]    ' adjust voice pitch
      GOSUB Check_Busy
      SEROUT TX, Baud, ["speed=1;"]    ' set speech speed
      GOSUB Check_Busy
      
    Talk:
      SEROUT TX,Baud,["say= I should be using pick basic pro;"] 
      GOSUB Check_Busy    ' wait for busy to release
      PAUSE 10000         ' long pause between message
      GOTO Talk
    
    ' -----[ Subroutines ]---------------------------------
    ' -- wait until Busy line released by Emic
    
    Check_Busy:
      PAUSE 5                      ' allow busy time to activate
      WHILE Busy = Yes : WEND      ' wait until not busy
      RETURN
        
    ' Hard reset
    ' -- good when comm link is lost
    
    Hard_Reset:                      ' reset to default values
      LOW Rst                        ' pull reset line low
      PAUSEUS 200                    ' 200uS pause
      INPUT Rst                      ' let reset float
    
      RETURN
    I've included the .hex file here for you. Wire your 16F876A to the EMIC as shown in the I/O
    Definitions section, and program it with the .hex file attached.

    If it doesn't work, then you may have a damaged EMIC module, bad speaker, or something
    isn't wired properly. If it does work, let me know.
    Attached Files Attached Files
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Write Onewire data toa I2C memory / read ASCI
    By Eugeniu in forum mel PIC BASIC Pro
    Replies: 67
    Last Post: - 16th November 2008, 19:19
  2. A Temperature & Humidity Data Recorder Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 9th July 2008, 18:47
  3. Who can help me checking my Programming
    By slimpeng in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 23rd January 2008, 15:08
  4. Conversion problem
    By eva in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th March 2007, 18:21
  5. Help for decimal conversion
    By eva in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th March 2007, 18:20

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts