Help with sound command in 2 programs


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    A couple of potential problems you might want to look at:

    Code:
    freq = 23*RPM + RPM/3		'Calculation of frequency
    period = (62500/freq)*16	'Calculation of period
    potential for overflow here. While the calculation 'as a whole' might not overflow, intermediate variables may overflow, if RPM is above 2849.

    Code:
    		pauseus (1000*period)/cnt		'Variable pause
    same thing with these lines. If period is over 65, the intermediate variables used in calculating the pauseus value may overflow.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    I didn't even think about the overflows, what's the best way to remedy that? The RPM value will stay pretty low, usually around 60, but I can see that being a problem with the calculations.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    So I just solved the problem, it's this line:

    Code:
    '********************************************************************************************************
    '
    '
    'Configuration Bit Definitions
    @ __config _CONFIG1, _INTRC_IO	'sets the INTRC-OSC2 as RA6
    '
    '
    '********************************************************************************************************
    This of course brings up new problems, I'm not 100% sure what this line does, but now I've gotta try to figure that out.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    So I figured out that the line in question enables i/o functions on RB5 and RB7, but I still need the sound command to work on RB3. I've been reading through the PIC16F88 datasheet and trying to figure out how to properly set the configuration bits to allow this, but have yet to have any luck. Any bright ideas?

Similar Threads

  1. How to drive the Vinculum VDIP1 in UART mode
    By BrianT in forum Code Examples
    Replies: 41
    Last Post: - 23rd May 2013, 12:34
  2. Delayed output 10 secs
    By lilimike in forum mel PIC BASIC Pro
    Replies: 37
    Last Post: - 14th October 2011, 06:28
  3. Replies: 4
    Last Post: - 15th April 2009, 01:54
  4. USB-FTDI[UM232R] with PIC16f877a
    By bjox in forum USB
    Replies: 1
    Last Post: - 23rd February 2008, 22:40
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

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