+ Reply to Thread
Page 2 of 2
First 1 2
Results 16 to 24 of 24

Thread: PIC 18F2550 and MT8888 DTMF Transceiver

  1. #16
    kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent
    Join Date
    Jul 2006
    Location
    Victoria BC, Canada
    Posts
    3,558

    I'd like to help you out, but I have neither PIC basic nor a MT8888 to try it out on. I've simply read the datasheet and tried to point you in the right direction. Anything I write would be pseudo code which you'd have to rewrite for it to work on your compiler. Here are some links that may help:
    Home security system
    It looks like the CM8888 is the same as the MT8888:
    Design and Implementation of DTMF Detector - Scientific, embedded, biomedical, electronics contents.
    Inside every little problem, is a big problem trying to get out.


  2. #17
    dbachman Newbie
    Join Date
    Oct 2008
    Posts
    16

    Hi Kchriste,

    I am waiting for a shipment of 6 new MT8888's before I continue. I have tried a bit to get this one to work but I think I may have fried it.

    Don

  3. #18
    dbachman Newbie
    Join Date
    Oct 2008
    Posts
    16

    Pic18F2550 and MT8888 problems

    Hi KChriste, Are you still around?

    I was wondering if you or someone could look at this code and see where I am going wrong. I realize you aren't PicBasic savvy but it is kind of straight forward. It still doesn't seem to work.

    Thanks, Don

    Code:
    OSCCON = $60 							'Set up internal oscillator
    
    CS var portb.4 							'Enable or disable MT8888 tied to ground
    RD var portb.5 							'Read Microprocessor input
    WR var portb.6 							'Write Microprocessor input
    RS var portb.7 							'Register Select
    
    TRISB = %00000000						'Set portb to output
    
    Init var byte 						
    Control var byte
    Dtmf var byte
    Status var byte
    w var byte
    X var byte
    y var byte
    z var byte
    
    data @1,%11000000,%10100000,%10101000,%10100000,%10101101,%10100000,%00001000,%00001110,%00000001,%00001110,%00000011,%00001110,%00000110 'Data starting at position #1
    
    Gosub Initialization
    gosub SetupControlRegister
    gosub WriteTransmitRegister
    
    Initialization:
    		Gosub ReadStatusRegister
    		for w = 2 to 4
    		read w, Init 				  'Read data statement starting at location #2 and put in Init
    		Init = Init & $0F			  'Mask off upper 4 bits with Logical AND
    		portb = Init | %11100000   		  'Set upper 3 bits with Logical OR and send to portb
    		pause 10 				  'Wait 1 millisecond (may not be needed)
           		low WR   				  'Take portb pin 6 low
           		pause 10 				  'Wait 1 millisecond (may not be needed)
          		high WR                        		  'take portb pin 6 high
          		pause 10
    		Next w
    		
    Return
    
    ReadstatusRegister:
    		
    		read 1, Status 				 'Read data statement starting at location #1 and put in Status   
    		Status = Status & $0F			 'Mask off upper 4 bits with Logical AND
    		portb = Status | %11100000 	 	 'Set upper 3 bits with Logical OR and send to portb
    		pause 10 				 'Wait 1 millisecond (may not be needed)
           		low RD   			         'Take portb pin 5 low
           		pause 10 				 'Wait 1 millisecond (may not be needed)
          		high RD   				 'take portb pin 5 high
          		pause 10
    Return
    
    
    SetupControlRegister:
    		
    		for x = 5 to 6
    		read x, Control 			 'Read data statement starting at location #6 and put in Control
    		Control = Control & $0F		 	 'Mask off upper 4 bits with Logical AND
    		portb = Control | %11100000  		 'Set upper 3 bits with Logical OR and send to portb
    		pause 10 				 'Wait 1 millisecond (may not be needed)
           		low WR   				 'Take portb pin 6 low
           		pause 10 				 'Wait 1 millisecond (may not be needed)
          		high WR   				 'take portb pin 6 high
          		pause 10
    		Next X
    Return
    
    
    WriteTransmitRegister:
    		
    		for y = 7 to 13               
    		read y, Dtmf 				 'Read data statement starting at location #9 and put in Dtmf
    		Dtmf = Dtmf & $0F			 'Mask off upper 4 bits with Logical AND
    		portb = Dtmf | %11100000 	         'Set upper 3 bits with Logical OR and send to portb
    		pause 10 				 'Wait 1 millisecond (may not be needed)
           		high RD   				 'Take portb pin 5 high
           		pause 10 				 'Wait 1 millisecond (may not be needed)
          		low RD     				 'take portb pin 5 low
          		pause 10
    		Next y
    
    Return
    
    
    End
    
    Last edited by dbachman; 19th January 2009 at 11:09 PM.

  4. #19
    kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent
    Join Date
    Jul 2006
    Location
    Victoria BC, Canada
    Posts
    3,558

    In your Initialization routine, you only do 3 writes to the control registers. The Data sheet shows 4 writes with the first two being duplicated. Since the upper 4bits are masked off anyway, you could fix that by changing for w = 2 to 4 to for w = 1 to 4
    There is also supposed to be a read from the status register at the beginning of the Initialization routine and at the end. You only have it at the beginning.
    I have only glanced briefly at the rest of the code.
    Last edited by kchriste; 20th January 2009 at 12:05 AM. Reason: for w = 2 to 4
    Inside every little problem, is a big problem trying to get out.

  5. #20
    dbachman Newbie
    Join Date
    Oct 2008
    Posts
    16

    The Apps engineer a Zarlink said the Write was a redundant one. Have a look at this code using an MT8880 (which is almost the same). It's datasheet is very similar. It doesn't even initialize it even tho the datasheet says it should. Also this attachment. I am not good at Assembly.

    Thanks, Don

    Code:
    ' Listing 1. Stamp-Based Autodialer
    ' Program: DIAL.SRC (Sends a string of DTMF tones via the 8880)
    ' This program demonstrates how to use the CM8880 as a DTMF tone
    ' generator. All that's required is to initialize the 8880 properly,
    ' then write the number of the desired DTMF tone to the 8880's
    ' 4-bit bus.
    ' The symbols below are the pin numbers to which the 8880's
    ' control inputs are connected, and one variable used to read
    ' digits out of a lookup table.
    SYMBOL RS_p = 4 ' Register-select pin (0=data).
    SYMBOL RW_p = 5 ' Read/Write pin (0=write).
    SYMBOL CS_p = 6 ' Chip-select pin (0=active).
    SYMBOL digit = b2 ' Index of digits to dial.
    ' This code initializes the 8880 for dialing by writing to its
    ' internal control registers CRA and CRB. The write occurs when
    ' CS (pin 6) is taken low, then returned high. See the accompanying
    ' article for an explanation of the 8880's registers.
    let pins = 255 ' All pins high to deselect 8880.
    let dirs = 255 ' Set up to write to 8880 (all outputs).
    let pins = %00011011 ' Set up register A, next write to register B.
    high CS_p
    let pins = %00010000 ' Clear register B; ready to send DTMF.
    high CS_p
    Stamp Applications no. 7, September 1995
    7
    ' This for/next loop dials the seven digits of my fax number. For
    ' simplicity, it writes the digit to be dialed directly to the output
    ' pins. Since valid digits are between 0 and 15, this also takes RS,
    ' RW, and CS low--perfect for writing data to the 8880. To complete
    ' the write, the CS line is returned high. The initialization above
    ' sets the 8880 for tone bursts of 200 ms duration, so we pause
    ' 250 ms between digits. Note: in the DTMF code as used by the phone
    ' system, zero is represented by ten (1010 binary) not 0. That's why
    ' the phone number 459-0623 is coded 4,5,9,10,6,2,3.
    for digit = 0 to 6
    lookup digit,(4,5,9,10,6,2,3),pins ' Write current digit to pins.
    high CS_p ' Done with write.
    pause 250 ' Wait to dial next digit.
    next digit
    end
    ' Listing 2.
    
    Attached Files

  6. #21
    kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent kchriste Excellent
    Join Date
    Jul 2006
    Location
    Victoria BC, Canada
    Posts
    3,558

    Well, you could try the example code you posted above. Looks like you'd have to mod your hardware a bit though. I noticed that the author is setting up the RW, RS, CS and data bits first and then just toggling CS high again to finish the write cycle. Might be worth giving it a try as the code has been tested so if it doesn't work then it must be a hardware issue. Might narrow things down for you.
    Inside every little problem, is a big problem trying to get out.

  7. #22
    dbachman Newbie
    Join Date
    Oct 2008
    Posts
    16

    I did give it a try but I am still waiting for the new MT8888's to come in the mail. They keep pushing the ship date out. I might be fighting a fried chip.

    Don

  8. #23
    meghana.mallikarjun Newbie
    Join Date
    Jul 2009
    Posts
    2

    hi sir

    is your module working sir?

    i have some doubts
    1}in data sheet it is specified that for 28pin, portb register are disable , but ur using portb only does it work?
    hope ull reply

  9. #24
    dbachman Newbie
    Join Date
    Oct 2008
    Posts
    16

    Quote Originally Posted by meghana.mallikarjun View Post
    hi sir

    is your module working sir?

    i have some doubts
    1}in data sheet it is specified that for 28pin, portb register are disable , but ur using portb only does it work?
    hope ull reply
    I have never been able to get it to work properly>>>>>>

+ Reply to Thread
Page 2 of 2
First 1 2

Similar Threads

  1. 18f2550 programming (HW)
    By lez in forum Micro Controllers
    Replies: 4
    Latest: 1st November 2009, 10:44 AM
  2. 18F2550 ADC troubleshooting
    By theo92 in forum Micro Controllers
    Replies: 0
    Latest: 12th December 2008, 01:37 PM
  3. 18F2550 USB on VB Express 2008
    By serkanc in forum Micro Controllers
    Replies: 4
    Latest: 18th May 2008, 02:04 PM
  4. 18f2550 and cypress FX2 programmer??
    By patroclus in forum Micro Controllers
    Replies: 15
    Latest: 17th July 2006, 09:23 AM
  5. 18f2550 programming (SW)
    By lez in forum Micro Controllers
    Replies: 4
    Latest: 6th June 2006, 12:45 PM

Tags for this Thread