Searching \ for '[PIC]: Waking from sleep on ADC change?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=adc
Search entire site for: 'Waking from sleep on ADC change?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Waking from sleep on ADC change?'
2002\06\10@052623 by Jonathan Starr

flavicon
face
Hi, this is my first post to the list so I hope it's going to the right place/formatted correctly :-)

I'm working on a (commercial) project that involves a 16C73, most of the other circuit functions are done but I still need to read ADC channel one (RA0), process the value and create a signal that gets sent to a piezo sounder.
The ADC is my main problem, I have it reading values, thanks to the Piclist FAQ, but I need the PIC to sleep for as much of the time as possible, it's currently sleeping while it converts then it wakes up and I send its value to the piezo code, but I need then to put it back into sleep and wait until ADC channel one or RA1 changes (circuit power use is critical).
I think I can work out how to wake from sleep on RA1 changing, but I don't even think it's possible to wake from sleep on a change in the analog input?

And, as a side note, does anyone know anything about piezo sounders?
On the sig-gen it's frequency response can only be described as pathetic, and it appears (annoyingly) to have a sweet spot at 3KHz, the customer wants a 'Tone' control and as I can't just vary the frequency like I was hoping to do I'm a bit at a loss.
I think something along the lines of a complex waveform with the ADC value being used to vary the harmonics would be the way forward, has anyone done this before?

Many thanks to anyone who can suggest anything,

Jonathan Starr    
R&D Technician
Electronix Limited

Tel +44 (0)1993 700510
Fax +44 (0)1993 700511


e-mail spam_OUTjonathansTakeThisOuTspamelectronix.co.uk

web http://www.electronix.co.uk

This e-mail has been sent to you by Electronix Ltd.
This communication is intended for the addressee only, is private and confidential, and is subject to the applicable terms and conditions.
If you are not the intended recipient, any disclosure, copying or
distribution of this information is strictly prohibited.

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2002\06\10@152138 by Michael Rigby-Jones

flavicon
face
{Quote hidden}

You have a problem in both cases.  RA1 has no interrupt on change facility,
unless this is a typo and you meant RB1?  There is no way to wake up from a
change in analog value as you suspected, the only wakeup ascociated with the
A/D converter is the end of conversion interrupt.  The ADC module itself
raises power consumption, so depending on how often you need to sample, you
might be better off using a timer interrupt to enable the ADC module  and
the ADC interrupt to disable the module, the aim being to keep the ADC
module disabled for as much time as possible.  The timer interrupt could be
used to check pin RA1 as well (assuming it wasn't a typo).

> And, as a side note, does anyone know anything about piezo sounders?
> On the sig-gen it's frequency response can only be described as pathetic,
> and it appears (annoyingly) to have a sweet spot at 3KHz, the customer
> wants a 'Tone' control and as I can't just vary the frequency like I was
> hoping to do I'm a bit at a loss.
> I think something along the lines of a complex waveform with the ADC value
> being used to vary the harmonics would be the way forward, has anyone done
> this before?
>
Common, cheap piezo sounders have a natural resonant frequency as you have
found, which is why they are generaly used for single tones, as warning
buzzers etc.  The resonant frequency and frequency response will be
determined to a large extent on how the bare piezo disk is mounted.
Obviously if you have a piezo that comes pre-mounted to a plastic casing
your choices are limited.  I don't think the complex waveform idea is going
to help much either, the piezo will only respond to the frequencies around
it's resonant point, irrespective if those frequencies are a fundamental or
a harmonic of the waveform you generated.

You can obtain piezo's with quite a wide frequency response, designed to be
used  as replacements for small speakers in e.g. laptops.
http://www.panasonic.com/industrial/components/pdf/card_speaker_dne.pdf is
an example.  I suspect they cost considerably more than the common devices
used for warning beeps etc.

If you could give an idea of the device being used I'm sure that you'd get
some suggestions from the list for improved performance.

Regards

Mike

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu


2002\06\11@063854 by Vasile Surducan

flavicon
face
On Mon, 10 Jun 2002, Michael Rigby-Jones wrote:

{Quote hidden}

 or to use interrupt on RB0 ( or any other interrupt on change) with a
comparator. If the analog input exceed the reference then an interrupt
will wake up the whole mess, perform the measurement and go back to sleep
again after it finished. A time delay will be necessary from the wake up
moment to measurement(s).
Vasile

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\06\11@070932 by Jonathan Starr

flavicon
face
Damn, I didn't think of the fact that it will use power even when the main core is asleep, that won't do.
I have revised the design, it will only sample the ADC when it needs to alarm, as the ADC value only affects the alarm tone there is no point me ever doing otherwise...whoops.
As for the wake-on-change I haven't ever used it before so I guess I did mean RB1 :-)

Thank-you everybody for your help with that.

I have got further with the piezo problem, for something with an appaling bandwidth it is suprisingly agile when it comes to making musical tones.
Although there is something that somebody may be able to help me with, a long time ago I'm sure I read of someones efforts to reproduce sounds via the PIC using a large RAM table with wave data in it, if anybody thinks they know a link it would be greatly appriciated, as melodys are extreamly hard to code as consecutive delays.  


>>> Vasile Surducan <vasilespamspam_OUTS3.ITIM-CJ.RO> 11/06/2002 11:42:28 >>>
On Mon, 10 Jun 2002, Michael Rigby-Jones wrote:

{Quote hidden}

 or to use interrupt on RB0 ( or any other interrupt on change) with a
comparator. If the analog input exceed the reference then an interrupt
will wake up the whole mess, perform the measurement and go back to sleep
again after it finished. A time delay will be necessary from the wake up
moment to measurement(s).
Vasile

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\06\11@072419 by Alan B. Pearce
face picon face
>Although there is something that somebody may be able
>to help me with, a long time ago I'm sure I read of
>someones efforts to reproduce sounds via the PIC using
>a large RAM table with wave data in it, if anybody
>thinks they know a link it would be greatly appriciated,
>as melodys are extreamly hard to code as consecutive delays.

Check out Olin Lathrop's sample application for the HAL device, it uses wav
files converted to data tables to produce sound output using the PWM
hardware.

see http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\06\11@085311 by Olin Lathrop

face picon face
>>
Although there is something that somebody may be able to help me with, a
long time ago I'm sure I read of someones efforts to reproduce sounds via
the PIC using a large RAM table with wave data in it, if anybody thinks they
know a link it would be greatly appriciated, as melodys are extreamly hard
to code as consecutive delays.
<<

My HAL project produces audio from WAV data stored in program memory.  See
http://www.embedinc.com/pic/hal.htm.  The details of fetching the WAV data,
interpolating adjacent samples, and writing to the PWM output are in the
HAL_INTR.ASPIC module.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\06\11@124011 by Dwayne Reid

flavicon
face
At 12:07 PM 6/11/02 +0100, Jonathan Starr wrote:
>Damn, I didn't think of the fact that it will use power even when the main
>core is asleep, that won't do.
>I have revised the design, it will only sample the ADC when it needs to
>alarm, as the ADC value only affects the alarm tone there is no point me
>ever doing otherwise...whoops.
>As for the wake-on-change I haven't ever used it before so I guess I did
>mean RB1 :-)

Actually, you need to use either RB0 (INTF) or any of RB4 thru RB7 (RBIF)
for wake up.  RB1 won't do it!

dwayne

--
Dwayne Reid   <@spam@dwaynerKILLspamspamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\06\12@044440 by Jonathan Starr

flavicon
face
Thank-you Olin, this looks exactly like the sort of thing I'm after, but I can't get wav_hal.exe to work.
I used:

C:\WINDOWS\Desktop\hal\embedinc\com\wav_hal.exe winex.wav

It gave me a lot of data about the wav file structure, but no output file (that I could find)

I looked in the source, and saw <in> <out> so I tried:

C:\WINDOWS\Desktop\hal\embedinc\com\wav_hal.exe winex.wav output.aspic

It said something like 'Invalid token found on line 2, token was 'output.aspic'

So how am I supposed to use it :)


>>> Olin Lathrop <KILLspamolin_piclistKILLspamspamEMBEDINC.COM> 11/06/2002 12:47:30 >>>
>>
Although there is something that somebody may be able to help me with, a
long time ago I'm sure I read of someones efforts to reproduce sounds via
the PIC using a large RAM table with wave data in it, if anybody thinks they
know a link it would be greatly appriciated, as melodys are extreamly hard
to code as consecutive delays.
<<

My HAL project produces audio from WAV data stored in program memory.  See
http://www.embedinc.com/pic/hal.htm.  The details of fetching the WAV data,
interpolating adjacent samples, and writing to the PWM output are in the
HAL_INTR.ASPIC module.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\12@164517 by Olin Lathrop

face picon face
>>
C:\WINDOWS\Desktop\hal\embedinc\com\wav_hal.exe winex.wav

It gave me a lot of data about the wav file structure, but no output file
(that I could find)

I looked in the source, and saw <in> <out> so I tried:

C:\WINDOWS\Desktop\hal\embedinc\com\wav_hal.exe winex.wav output.aspic

It said something like 'Invalid token found on line 2, token was
'output.aspic'

So how am I supposed to use it :)
<<

That sounds more like the WAV_INFO program than the WAV_HAL program, or a
very ancient version of WAV_HAL.  Where did you get this version from?

Just to be sure, I put up a fresh releases of the PIC development tools and
the HAL project.  I also added a separate release of the general WAV file
manipulation utilities.  See http://www.embedinc.com/pic/dload.htm.

As an example, I just went to a temp directory and entered:

 wav_hal /winnt/media/tada -rrate .5

and it made TADA.ASPIC and TADA.WAV files just like it's supposed to.  If
you install the PICDEV and PIC_HAL releases, please let me know if WAV_HAL
then works correctly.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\12@202032 by Michael Rigby-Jones

flavicon
face
{Quote hidden}

You have a problem in both cases.  RA1 has no interrupt on change facility,
unless this is a typo and you meant RB1?  There is no way to wake up from a
change in analog value as you suspected, the only wakeup ascociated with the
A/D converter is the end of conversion interrupt.  The ADC module itself
raises power consumption, so depending on how often you need to sample, you
might be better off using a timer interrupt to enable the ADC module  and
the ADC interrupt to disable the module, the aim being to keep the ADC
module disabled for as much time as possible.  The timer interrupt could be
used to check pin RA1 as well (assuming it wasn't a typo).

> And, as a side note, does anyone know anything about piezo sounders?
> On the sig-gen it's frequency response can only be described as pathetic,
> and it appears (annoyingly) to have a sweet spot at 3KHz, the customer
> wants a 'Tone' control and as I can't just vary the frequency like I was
> hoping to do I'm a bit at a loss.
> I think something along the lines of a complex waveform with the ADC value
> being used to vary the harmonics would be the way forward, has anyone done
> this before?
>
Common, cheap piezo sounders have a natural resonant frequency as you have
found, which is why they are generaly used for single tones, as warning
buzzers etc.  The resonant frequency and frequency response will be
determined to a large extent on how the bare piezo disk is mounted.
Obviously if you have a piezo that comes pre-mounted to a plastic casing
your choices are limited.  I don't think the complex waveform idea is going
to help much either, the piezo will only respond to the frequencies around
it's resonant point, irrespective if those frequencies are a fundamental or
a harmonic of the waveform you generated.

You can obtain piezo's with quite a wide frequency response, designed to be
used  as replacements for small speakers in e.g. laptops.
http://www.panasonic.com/industrial/components/pdf/card_speaker_dne.pdf is
an example.  I suspect they cost considerably more than the common devices
used for warning beeps etc.

If you could give an idea of the device being used I'm sure that you'd get
some suggestions from the list for improved performance.

Regards

Mike

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\06\13@084607 by Jonathan Starr

flavicon
face
Thank you for the link, I was using the version from the Piclist source code archives so it probably was old.

I have a problem though, none of the new installers will install:


Software installation source directory is C:\WINDOWS\TEMP\WZSE0.TMP\embedinc.

No previous installation of this software was detected.

Enter where you want the software installed, or hit ENTER to choose the
default shown in parenthesis.
(C:\embedinc):
Running: cmd /c util\fix_attrib
*** System error 2 (h00000002).
The system cannot find the file specified.
INSTALL program aborted due to error in subordinate command.
*** Program aborted on error. ***

Errors occurred during software installation.
Hit ENTER to exit the software installer.


It does this on all the installers and it makes no deference where I install it to, my other PC has the same problem with them, but maybe they don't like Win98.
Do you posibly have them in a zip file?






>>> Olin Lathrop <TakeThisOuTolin_piclistEraseMEspamspam_OUTEMBEDINC.COM> 12/06/2002 21:43:27 >>>
>>
C:\WINDOWS\Desktop\hal\embedinc\com\wav_hal.exe winex.wav

It gave me a lot of data about the wav file structure, but no output file
(that I could find)

I looked in the source, and saw <in> <out> so I tried:

C:\WINDOWS\Desktop\hal\embedinc\com\wav_hal.exe winex.wav output.aspic

It said something like 'Invalid token found on line 2, token was
'output.aspic'

So how am I supposed to use it :)
<<

That sounds more like the WAV_INFO program than the WAV_HAL program, or a
very ancient version of WAV_HAL.  Where did you get this version from?

Just to be sure, I put up a fresh releases of the PIC development tools and
the HAL project.  I also added a separate release of the general WAV file
manipulation utilities.  See http://www.embedinc.com/pic/dload.htm.

As an example, I just went to a temp directory and entered:

 wav_hal /winnt/media/tada -rrate .5

and it made TADA.ASPIC and TADA.WAV files just like it's supposed to.  If
you install the PICDEV and PIC_HAL releases, please let me know if WAV_HAL
then works correctly.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics
--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...