Help w/ speaker for 16F690 and SOUND command


Results 1 to 14 of 14

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    From the Data sheet: ANSEL and ANSELH must be configured to use port C as I/O.
    Code:
    ;@MyConfig =  
    @MyConfig = _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON  
    @MyConfig = MyConfig & _MCLRE_ON & _BOR_OFF 
    @ __config  MyConfig 
    
    DEFINE OSC 4
    PortA = 0
    PortB = 0
    PortC = 0
    TRISA = 1
    TRISB = 0
    TRISC = 0
    i var byte
    ANSEL = 0
    ANSELH = 0
    CM1CON0 = 0
    CM2CON0 = 0
    main:
    
    portc = 0
    pause 500
    
    for i = 1 to 15; step -1
    
    
    portC = i
    i=i  << 1 
    pause 250
    next i
    sound portB.6, [120,2,124,2,123,2,121,2]
    sound portC.6, [120,2,124,2,123,2,121,2]
    goto main
    end
    Without them sound works on PortB but not PortC, the code snippet above is configured to use the MicroChip low parts count demo board.
    Last edited by Archangel; - 21st March 2009 at 02:08.
    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. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  2. Replies: 4
    Last Post: - 10th November 2006, 07:37
  3. SOUND command not working
    By RUBiksCUbe in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th December 2005, 22:41
  4. question about SOUND command
    By bartman in forum General
    Replies: 7
    Last Post: - 1st December 2005, 13:50
  5. Re: quick fix for sound command?
    By Melanie in forum Code Examples
    Replies: 0
    Last Post: - 9th July 2004, 01:44

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