NS73M fm radio trasmitter


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    I guess I am missing some elementary issues, but I cannot seem to figure out why I cannot get this to work.

    Here is a sample of my code:

    Code:
    REM Above this is just LCD and button setups...
    
    NS_CK VAR PORTC.1
    NS_DA VAR PORTC.2
    
    FREQ VAR WORD 'REM Consisting of FREQ.1 and FREQ.2 (Hi/Lo Byte)
    MYREG VAR BYTE 'REM Register of NS73M
    MYVAL VAR BYTE 'REM Value for register in NS73M
    MYCON VAR BYTE 'REM Control Value for NS73M
    
    START:
    'REM The Theory is that we setup all parameters, then turn it on.
    
    MYCON = %11001100 'REM Setup Control Address for NS73M
    PAUSE 100 'REM Breathe a moment; let the chip get settled...
    
    I2CWRITE NS_DA,NS_CK,MYCON,$0E,[$05] 'REM SOFTWARE RESET NS73M Chip
    PAUSE 100
    I2CWRITE NS_DA,NS_CK,MYCON,$01,[$B4] 'REM Pilot On, Subcarrier On
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$02,[$07] 'REM 2mw Power, Unlock Detect ON
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$08,[$1A] 'REM CEX Band 2
    PAUSE 10
    'REM Again, theory is that I am transmitting on 88.5MHz, as per datasheet...
    I2CWRITE NS_DA,NS_CK,MYCON,$03,[$58] 'REM Frequency; Lower Byte
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$04,[$2A] 'REM Frequency; Upper Byte
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$00,[$A3] 'REM Power, 200mv Audio, 75us PE
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$0E,[$05] 'REM SOFTWARE RESET NS73M
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$06,[$1E] 'REM Charge Pumps
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$0E,[$05] 'REM SOFTWARE RESET NS73M
    PAUSE 10
    
    REM Just a note to let me know it got through the code unscathed...
    
    	LCDOUT $FE, 1
    	LCDOUT $FE, 2
    	PAUSE 500
    	LCDOUT $FE, $80
    	LCDOUT "Transmitting?" 
    	LCDOUT $FE, $C0
    	LCDOUT "  supposedly..."
    	PAUSE 1000
    
    END
    At first I was trying this with a 16F84A, and moved to a 16F877A just to make sure there was nothing wrong with my chips. I get the same results; nothing.

    This is my first attempt at I2C communications, so I am not certain what, if any, feedback I can expect. My current feedback is nothing works, lol!

    Any pointers on where my code is lacking, or erroneous, would be greatly appreciated!

    Cheers!

    SmugWimp

  2. #2
    Join Date
    Jan 2009
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Hold the phone folks; I think I may have a hardware issue. I almost hope so, anyway. heh.

    BBIAF...

    SmugWimp

  3. #3
    Join Date
    Jan 2009
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    No Such Luck. What I thought was a miswiring turned out to be correct. But I did remove some (as of yet) unneeded wires for the buttons, until I get the rest of this moving along. It doesnt work any better, but it is easier to see.

    Here is the latest rendition of code:

    Code:
    REM LCD PIN Assignments above...
    
    NS_DA VAR PORTB.1
    NS_CK VAR PORTB.2
    MYCON VAR BYTE 'REM Control Value for NS73M
    
    START:
    'REM The Theory is that we setup all parameters, then turn it on.
    MYCON = $CC 'REM Setup Control Address for NS73M
    PAUSE 100 'REM Breathe a moment; let the chip get settled...
    
    REM I2CWRITE DATAPIN,CLOCKPIN,CONTROLADDRESS,PORTADDRESS,[DATAINBRACKETS]{, OPTIONALJUMPTOLABEL}
    
    I2CWRITE NS_DA,NS_CK,MYCON,$0E,[$05], BOOHA 'REM SOFTWARE RESET NS73M Chip
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$00,[$A0] 'REM Set it up, dont turn it on yet...
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$01,[$B4] 'REM Pilot On, Subcarrier On
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$02,[$07] 'REM 2mw Power, Unlock Detect ON
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$03,[$58] 'REM Frequency; Lower Byte
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$04,[$2A] 'REM Frequency; Upper Byte
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$08,[$1A] 'REM CEX Band 2
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$00,[$A1] 'REM Ok, Turn it on...
    PAUSE 10
    I2CWRITE NS_DA,NS_CK,MYCON,$0E,[$05] 'REM SOFTWARE RESET NS73M Chip
    PAUSE 100
    I2CWRITE NS_DA,NS_CK,MYCON,$06,[$1E] 'REM Charge Pump
    PAUSE 10
    LCDOUT $FE, 1
    LCDOUT $FE, 2
    PAUSE 500
    LCDOUT $FE, $80
    LCDOUT "Transmitting?" 
    LCDOUT $FE, $C0
    LCDOUT "  supposedly..."
    PAUSE 1000
    GOTO THEEND
    
    BOOHA:
    	LCDOUT $FE, 1
    	LCDOUT $FE, 2
    	PAUSE 500
    	LCDOUT $FE, $80
    	LCDOUT "No ACK" 
    	LCDOUT $FE, $C0
    	LCDOUT ":("
    	PAUSE 1000
    	GOTO THEEND
    
    THEEND:
    END
    Interestingly enough, One of the reasons I thought it was a hardware failure, was I could remove one, or both of the I2C lines and still not get an error (evidenced by the optional jump label on the first I2CWRITE command, to reset the NS73M). However, if I "swapped" the lines, then I DID get a "No ACK" error. Weird. I still dont understand that. But it is wired correctly.

    I moved back to a 16F84A because it wasnt the problem and I have a bunch that I want to use.

    On the 16F84A, Pins A0-4 are used for data and RS for the LCD. Pin B0 is the E pin for the LCD, B1 is the I2C Data line, and B2 is the I2C Clock.

    On the SparkFun board, Line In is attached to my Ipod, IIC is attached to +3.3v, LA is attached to Ground, Data to B1, Clock to B2, TEB not connected, VCC to +3.3v and Ground to Ground.

    Again, It seems like it "should" work, but alas it does not. Any ideas would be greatly appreciated!

    Cheers!

    SmugWimp

  4. #4
    Join Date
    Jan 2004
    Location
    Grand Lake O' Cherokees USA
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Just a guess here but the NS73M is not 5V tolerant. The pins connected to the PIC should be level compensated to match the logic levels required for the NS73M or a 3V PIC should be used.

    I use the NS73M quite reliably but not in I2C mode and my routines are written in Swordfish so I can't really comment on your code. Sorry I can't help more.....

    Tom
    Tom

  5. #5
    Join Date
    Jan 2009
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Tom, Thanks!

    Yeah, I have the NS73M on the end of a 3.3v regulator, and all but the LCD is on 3.3v.

    If I cant get I2C working, I guess I will go with the 3 wire... but was hoping not to have to use that extra pin...

    So goes life...

    Cheers!

    SmugWimp

  6. #6
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Tom Estes View Post
    Just a guess here but the NS73M is not 5V tolerant. The pins connected to the PIC should be level compensated to match the logic levels required for the NS73M or a 3V PIC should be used.

    I use the NS73M quite reliably but not in I2C mode and my routines are written in Swordfish so I can't really comment on your code. Sorry I can't help more.....

    Tom
    If you want post the code.
    Thanks

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hello SmugWimp,
    16F877a has a bunch of analog stuff, some of it on portC, including C.1 and you must disable to send I²C as that data is digital. How about posting the whole code including the config statements. I would read sec. 4.3 of the data sheet, it explains about using portC in I²C communications and which pins to use. I do not know how much it affects the operation, but portC has Schmitt trigger input buffers. It may be because of that, it will only work on the pins Microchip has designated as I²C , it is certainly worth the effort to check. BTW, I do not see the jump label or a subroutine to be jumped to, must be in the unposted code . . . Have you attempted to try this on PortB ? No S. T. on the inputs there. here is a link of someone who got I²C to work : http://www.picbasic.co.uk/forum/showthread.php?t=5632 Looks like I2CWRITE is not a stand alone statement, looks like it requires all the registers to be set as the datasheet specifys . . . The manual gives the impression this is a bit banged solution, sort of looks like it is not.
    Last edited by Archangel; - 5th February 2009 at 19:24.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Look at this thread it discusses using I²C w 3.3v . . . http://www.picbasic.co.uk/forum/show...9879#post69879 I noticed a comment re: not using schmitt trigger inputs . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Car radio (Car radio and electronics support forum)
    By freewillover in forum Forum Requests
    Replies: 1
    Last Post: - 1st July 2009, 19:41
  2. FM Radio transmitter PIC Interface.
    By koossa in forum Off Topic
    Replies: 2
    Last Post: - 30th November 2008, 09:05
  3. Replies: 5
    Last Post: - 6th September 2007, 04:59
  4. Newbie radio link issue
    By George in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 28th February 2007, 04:28
  5. LPRS/miniature radio modules
    By fowardbias in forum Off Topic
    Replies: 1
    Last Post: - 20th September 2005, 01:03

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