A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
generating square waves - ray xu - Sep 12 23:17:08 2008
I just have a simple question dealing with the dsPIC30F2010. Is it possible
to generate an adjustable frequency square wave (from 1MHz to 40MHz)
directly out of the chip? Just in case you didn't know, I have no
experience with the PIC. I am driving the PIC at 40MHz. Thanks.
___________________
Ray Xu
r...@tx.rr.com
DPRG
member
OOPic group member
Seattle Robotics
group member
My Blog

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )
Re: generating square waves - Eirik Karlsen - Sep 13 5:25:39 2008
Yes, and no....
Generating a square wave is maybe best done by togeling a port pin at double the
frequency, this will give you a square (50/50 mark space) wave.
You'll have to do this at a steady 2x frequency so it must be done from a 1 priority
interupt... any latency or skipped interrups will slightly alter the
50/50 ratio for that period.
But doing it at 40x2 Mhz forget it !
A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port pin.... and
that would take virtualy 100% of the processing power available.
I dunno about the dsPICs they may have something on chip that can generate such signals
but I doubt it.
My best guess is that you should go for external circutry. A serially / SPI controlled
PLL RF generator / RF synteziser chip should do the job nicely...
maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of band switching
if using LC tuning. If you can find a chip that uses RC tuning
you should get a much larger range, maybe even avoiding band switching altogether.
http://hem.passagen.se/communication/rfinject.html
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1257
http://www.sxlist.com/images/www/hobby_elec/e_ckt15.htm
http://www.datasheetcatalog.org/datasheet/philips/TEA6100.pdf
ray xu wrote:
> I just have a simple question dealing with the dsPIC30F2010. Is it possible to
generate an adjustable frequency square wave (from 1MHz to 40MHz) directly out of the
chip? Just in case you didnt
> know, I have no experience with the PIC. I am driving the PIC at 40MHz. Thanks.
>
> ___________________
> Ray Xu
> r...@tx.rr.com
> DPRG member
> OOPic group member
> Seattle Robotics group member
> My Blog
--
*******************************************
VISIT MY HOME PAGE:
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - Eirik Karlsen - Sep 13 6:19:57 2008
Ray Xu,
The TSA6057 chip plus a digital VCO might be just what you need.
Eirik Karlsen wrote:
> Yes, and no....
>
> Generating a square wave is maybe best done by togeling a port pin at double the
frequency, this will give you a square (50/50 mark space) wave.
> You'll have to do this at a steady 2x frequency so it must be done from a 1 priority
interupt... any latency or skipped interrups will slightly alter the
> 50/50 ratio for that period.
>
> But doing it at 40x2 Mhz forget it !
> A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port pin.... and
that would take virtualy 100% of the processing power available.
>
> I dunno about the dsPICs they may have something on chip that can generate such signals
but I doubt it.
>
> My best guess is that you should go for external circutry. A serially / SPI controlled
PLL RF generator / RF synteziser chip should do the job nicely...
> maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of band
switching if using LC tuning. If you can find a chip that uses RC tuning
> you should get a much larger range, maybe even avoiding band switching altogether.
>
> http://hem.passagen.se/communication/rfinject.html
> http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1257
> http://www.sxlist.com/images/www/hobby_elec/e_ckt15.htm
> http://www.datasheetcatalog.org/datasheet/philips/TEA6100.pdf
>
> ray xu wrote:
>
>> I just have a simple question dealing with the dsPIC30F2010. Is it possible to
generate an adjustable frequency square wave (from 1MHz to 40MHz) directly out of the
chip? Just in case you didnt
>> know, I have no experience with the PIC. I am driving the PIC at 40MHz. Thanks.
>>
>> ___________________
>> Ray Xu
>> r...@tx.rr.com
>> DPRG member
>> OOPic group member
>> Seattle Robotics group member
>> My Blog
> --
> *******************************************
> VISIT MY HOME PAGE:
>
> LAST UPDATED: 23/08/2003
> *******************************************
> Regards
> Eirik Karlsen
--
*******************************************
VISIT MY HOME PAGE:
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - Michael Harpe - Sep 13 8:22:07 2008
I thought using one of the timers was the preferred way to generate a waveform on a
pin.
Mike Harpe
--- On Sat, 9/13/08, Eirik Karlsen
wrote:
From: Eirik Karlsen
Subject: Re: [piclist] generating square waves
To: p...@yahoogroups.com
Date: Saturday, September 13, 2008, 5:25 AM
Yes, and no....
Generating a square wave is maybe best done by togeling a port pin at
double the frequency, this will give you a square (50/50 mark space) wave.
You'll have to do this at a steady 2x frequency so it must be done
from a 1 priority interupt... any latency or skipped interrups will slightly
alter the
50/50 ratio for that period.
But doing it at 40x2 Mhz forget it !
A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the
port pin.... and that would take virtualy 100% of the processing power
available.
I dunno about the dsPICs they may have something on chip that can generate
such signals but I doubt it.
My best guess is that you should go for external circutry. A serially
/ SPI controlled PLL RF generator / RF synteziser chip should do the job
nicely...
maybe even down to 1Hz resolution. For a range of 1:40 expect some
sort of band switching if using LC tuning. If you can find a chip that
uses RC tuning
you should get a much larger range, maybe even avoiding band switching
altogether.
http://hem.passagen.se/communication/rfinject.html
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1257
http://www.sxlist.com/images/www/hobby_elec/e_ckt15.htm
http://www.datasheetcatalog.org/datasheet/philips/TEA6100.pdf
ray xu wrote:
I
just have a simple question dealing with the dsPIC30F2010. Is it
possible to generate an adjustable frequency square wave (from 1MHz to
40MHz) directly out of the chip? Just in case you didnąt know, I
have no experience with the PIC. I am driving the PIC at 40MHz.
Thanks.
____________ _______
Ray Xu
r...@tx.rr. com
DPRG
member
OOPic
group member
Seattle
Robotics group member
My
Blog
--
*******************************************
VISIT MY HOME PAGE:
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - Jan Didden / Linear Audio - Sep 13 8:51:55 2008
Yes, you can use one of the CCP or PWM registers, set up a timer with the
freq you want and let it run. Takes virtually zero processing power.
Jan Didden
_____
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Michael Harpe
Sent: Saturday, September 13, 2008 2:21 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
I thought using one of the timers was the preferred way to generate a
waveform on a pin.
Mike Harpe
--- On Sat, 9/13/08, Eirik Karlsen
wrote:
From: Eirik Karlsen
Subject: Re: [piclist] generating square waves
To: p...@yahoogroups.com
Date: Saturday, September 13, 2008, 5:25 AM
Yes, and no....
Generating a square wave is maybe best done by togeling a port pin at double
the frequency, this will give you a square (50/50 mark space) wave.
You'll have to do this at a steady 2x frequency so it must be done from a 1
priority interupt... any latency or skipped interrups will slightly alter
the
50/50 ratio for that period.
But doing it at 40x2 Mhz forget it !
A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port
pin.... and that would take virtualy 100% of the processing power available.
I dunno about the dsPICs they may have something on chip that can generate
such signals but I doubt it.
My best guess is that you should go for external circutry. A serially / SPI
controlled PLL RF generator / RF synteziser chip should do the job nicely...
maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of
band switching if using LC tuning. If you can find a chip that uses RC
tuning
you should get a much larger range, maybe even avoiding band switching
altogether.
http://hem.passagen
.se/communication/rfinject.html
http://www.maxim-
ic.com/quick_view2.cfm/qv_pk/1257
http://www.sxlist.
com/images/www/hobby_elec/e_ckt15.htm
http://www.datashee
tcatalog.org/datasheet/philips/TEA6100.pdf
ray xu wrote:
I just have a simple question dealing with the dsPIC30F2010. Is it possible
to generate an adjustable frequency square wave (from 1MHz to 40MHz)
directly out of the chip? Just in case you didn?t know, I have no
experience with the PIC. I am driving the PIC at 40MHz. Thanks.
____________ _______
Ray Xu
r...@tx.rr. com
DPRG member
OOPic group member
Seattle Robotics
group member
My Blog
--
*******************************************
VISIT MY HOME PAGE:
online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - ray xu - Sep 13 10:33:20 2008
So is it possible to only use a PWM register (and no timers) to let it make
a square waveform? If I were o do it like this, would it be able to
generate a maximum of 30MHz (MIPS is 30 too)?
___________________
Ray Xu
r...@tx.rr.com
DPRG
member
OOPic group member
Seattle Robotics
group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Jan Didden / Linear Audio
Sent: Saturday, September 13, 2008 7:52 AM
To: p...@yahoogroups.com
Subject: RE: [piclist] generating square waves
Yes, you can use one of the CCP or PWM registers, set up a timer with the
freq you want and let it run. Takes virtually zero processing power.
Jan Didden
_____
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Michael Harpe
Sent: Saturday, September 13, 2008 2:21 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
I thought using one of the timers was the preferred way to generate a
waveform on a pin.
Mike Harpe
--- On Sat, 9/13/08, Eirik Karlsen wrote:
From: Eirik Karlsen
Subject: Re: [piclist] generating square waves
To: p...@yahoogroups.com
Date: Saturday, September 13, 2008, 5:25 AM
Yes, and no....
Generating a square wave is maybe best done by togeling a port pin at double
the frequency, this will give you a square (50/50 mark space) wave.
You'll have to do this at a steady 2x frequency so it must be done from a 1
priority interupt... any latency or skipped interrups will slightly alter
the
50/50 ratio for that period.
But doing it at 40x2 Mhz forget it !
A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port
pin.... and that would take virtualy 100% of the processing power available.
I dunno about the dsPICs they may have something on chip that can generate
such signals but I doubt it.
My best guess is that you should go for external circutry. A serially / SPI
controlled PLL RF generator / RF synteziser chip should do the job nicely...
maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of
band switching if using LC tuning. If you can find a chip that uses RC
tuning
you should get a much larger range, maybe even avoiding band switching
altogether.
http://hem.passagen
.se/communication/rfinject.html
http://www.maxim-
ic.com/quick_view2.cfm/qv_pk/1257
http://www.sxlist.
com/images/www/hobby_elec/e_ckt15.htm
http://www.datashee
tcatalog.org/datasheet/philips/TEA6100.pdf
ray xu wrote:
I just have a simple question dealing with the dsPIC30F2010. Is it possible
to generate an adjustable frequency square wave (from 1MHz to 40MHz)
directly out of the chip? Just in case you didn?t know, I have no
experience with the PIC. I am driving the PIC at 40MHz. Thanks.
____________ _______
Ray Xu
r...@tx.rr. com
DPRG member
OOPic group member
Seattle Robotics
group member
My Blog
--
*******************************************
VISIT MY HOME PAGE:
online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - Jan Didden / Linear Audio - Sep 13 10:53:04 2008
I think it uses one of the available timers, like in the 16F685 I used it
uses T2. But once you set up all the registers, it runs without any further
intervention. You would have to check the data sheet for your chip.
For a 40Mhz clock I think the max freq would be 10MHz, but, again, check the
data sheet for details. There is always a detailed description of the PWM
functionality.
Jan Didden
_____
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
ray xu
Sent: Saturday, September 13, 2008 4:33 PM
To: p...@yahoogroups.com
Subject: RE: [piclist] generating square waves
So is it possible to only use a PWM register (and no timers) to let it make
a square waveform? If I were o do it like this, would it be able to
generate a maximum of 30MHz (MIPS is 30 too)?
___________________
Ray Xu
r...@tx.rr.
com
DPRG member
OOPic group member
Seattle Robotics
group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Jan Didden / Linear Audio
Sent: Saturday, September 13, 2008 7:52 AM
To: p...@yahoogroups.com
Subject: RE: [piclist] generating square waves
Yes, you can use one of the CCP or PWM registers, set up a timer with the
freq you want and let it run. Takes virtually zero processing power.
Jan Didden
_____
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Michael Harpe
Sent: Saturday, September 13, 2008 2:21 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
I thought using one of the timers was the preferred way to generate a
waveform on a pin.
Mike Harpe
--- On Sat, 9/13/08, Eirik Karlsen wrote:
From: Eirik Karlsen
Subject: Re: [piclist] generating square waves
To: p...@yahoogroups.com
Date: Saturday, September 13, 2008, 5:25 AM
Yes, and no....
Generating a square wave is maybe best done by togeling a port pin at double
the frequency, this will give you a square (50/50 mark space) wave.
You'll have to do this at a steady 2x frequency so it must be done from a 1
priority interupt... any latency or skipped interrups will slightly alter
the
50/50 ratio for that period.
But doing it at 40x2 Mhz forget it !
A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port
pin.... and that would take virtualy 100% of the processing power available.
I dunno about the dsPICs they may have something on chip that can generate
such signals but I doubt it.
My best guess is that you should go for external circutry. A serially / SPI
controlled PLL RF generator / RF synteziser chip should do the job nicely...
maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of
band switching if using LC tuning. If you can find a chip that uses RC
tuning
you should get a much larger range, maybe even avoiding band switching
altogether.
http://hem.passagen
.se/communication/rfinject.html
http://www.maxim-
ic.com/quick_view2.cfm/qv_pk/1257
http://www.sxlist.
com/images/www/hobby_elec/e_ckt15.htm
http://www.datashee
tcatalog.org/datasheet/philips/TEA6100.pdf
ray xu wrote:
I just have a simple question dealing with the dsPIC30F2010. Is it possible
to generate an adjustable frequency square wave (from 1MHz to 40MHz)
directly out of the chip? Just in case you didn?t know, I have no
experience with the PIC. I am driving the PIC at 40MHz. Thanks.
____________ _______
Ray Xu
r...@tx.rr. com
DPRG member
OOPic group member
Seattle Robotics
group member
My Blog
--
*******************************************
VISIT MY HOME PAGE:
online.no/~eikarlse/index.htm>
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - "John J. McDonough, WB8RCR" - Sep 13 11:05:09 2008
To get 30 MIPS you need to run the 30F at 120 MHz (which it will do ... 7.5
MHz X 16). I don't think you can use a 30 MHz crystal, I think that may
still be limited to 20, I'm a little fuzzy on that. But crystals above 10
can only be multiplied by 1, so a 10 MHz crystal X 4 (10 MIPS) is a better
deal than 30 X 1 (7.5 MIPS). Even a 4 MHz rock will get you to 16 MIPS.
72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
----- Original Message -----
From: ray xu
To: p...@yahoogroups.com
Sent: Saturday, September 13, 2008 10:33 AM
Subject: RE: [piclist] generating square waves
So is it possible to only use a PWM register (and no timers) to let it make
a square waveform? If I were o do it like this, would it be able to
generate a maximum of 30MHz (MIPS is 30 too)?
___________________
Ray Xu
r...@tx.rr.com
DPRG member
OOPic group member
Seattle Robotics group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Jan Didden / Linear Audio
Sent: Saturday, September 13, 2008 7:52 AM
To: p...@yahoogroups.com
Subject: RE: [piclist] generating square waves
Yes, you can use one of the CCP or PWM registers, set up a timer with the
freq you want and let it run. Takes virtually zero processing power.
Jan Didden
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Michael Harpe
Sent: Saturday, September 13, 2008 2:21 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
I thought using one of the timers was the preferred way to generate a
waveform on a pin.
Mike Harpe
--- On Sat, 9/13/08, Eirik Karlsen
wrote:
From: Eirik Karlsen
Subject: Re: [piclist] generating square waves
To: p...@yahoogroups.com
Date: Saturday, September 13, 2008, 5:25 AM
Yes, and no....
Generating a square wave is maybe best done by togeling a port pin at double
the frequency, this will give you a square (50/50 mark space) wave.
You'll have to do this at a steady 2x frequency so it must be done from a 1
priority interupt... any latency or skipped interrups will slightly alter
the
50/50 ratio for that period.
But doing it at 40x2 Mhz forget it !
A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port
pin.... and that would take virtualy 100% of the processing power available.
I dunno about the dsPICs they may have something on chip that can generate
such signals but I doubt it.
My best guess is that you should go for external circutry. A serially / SPI
controlled PLL RF generator / RF synteziser chip should do the job nicely...
maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of
band switching if using LC tuning. If you can find a chip that uses RC
tuning
you should get a much larger range, maybe even avoiding band switching
altogether.
http://hem.passagen.se/communication/rfinject.html
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1257
http://www.sxlist.com/images/www/hobby_elec/e_ckt15.htm
http://www.datasheetcatalog.org/datasheet/philips/TEA6100.pdf
ray xu wrote:
I just have a simple question dealing with the dsPIC30F2010. Is it possible
to generate an adjustable frequency square wave (from 1MHz to 40MHz)
directly out of the chip? Just in case you didnąt know, I have no
experience with the PIC. I am driving the PIC at 40MHz. Thanks.
____________ _______
Ray Xu
r...@tx.rr. com
DPRG member
OOPic group member
Seattle Robotics group member
My Blog
--
*******************************************
VISIT MY HOME PAGE:
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen
------------------------------------
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - ray xu - Sep 13 11:12:20 2008
So if I want to achieve 30MIPS, I would need to over-clock it (is that even
possible)? I looked on the datasheet; it says I can achieve 30MIPS with
40MHz external clock source.
Also, what is the maximum frequency that the internal oscillator can output
for the 32-bit timer?
___________________
Ray Xu
r...@tx.rr.com
DPRG member
OOPic group member
Seattle Robotics group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
John J. McDonough, WB8RCR
Sent: Saturday, September 13, 2008 10:05 AM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
To get 30 MIPS you need to run the 30F at 120 MHz (which it will do ... 7.5
MHz X 16). I don't think you can use a 30 MHz crystal, I think that may
still be limited to 20, I'm a little fuzzy on that. But crystals above 10
can only be multiplied by 1, so a 10 MHz crystal X 4 (10 MIPS) is a better
deal than 30 X 1 (7.5 MIPS). Even a 4 MHz rock will get you to 16 MIPS.
72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
----- Original Message -----
From: ray xu
To: p...@yahoogroups.com
Sent: Saturday, September 13, 2008 10:33 AM
Subject: RE: [piclist] generating square waves
So is it possible to only use a PWM register (and no timers) to let it make
a square waveform? If I were o do it like this, would it be able to
generate a maximum of 30MHz (MIPS is 30 too)?
___________________
Ray Xu
r...@tx.rr.com
DPRG member
OOPic group member
Seattle Robotics group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Jan Didden / Linear Audio
Sent: Saturday, September 13, 2008 7:52 AM
To: p...@yahoogroups.com
Subject: RE: [piclist] generating square waves
Yes, you can use one of the CCP or PWM registers, set up a timer with the
freq you want and let it run. Takes virtually zero processing power.
Jan Didden
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
Michael Harpe
Sent: Saturday, September 13, 2008 2:21 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
I thought using one of the timers was the preferred way to generate a
waveform on a pin.
Mike Harpe
--- On Sat, 9/13/08, Eirik Karlsen
wrote:
From: Eirik Karlsen
Subject: Re: [piclist] generating square waves
To: p...@yahoogroups.com
Date: Saturday, September 13, 2008, 5:25 AM
Yes, and no....
Generating a square wave is maybe best done by togeling a port pin at double
the frequency, this will give you a square (50/50 mark space) wave.
You'll have to do this at a steady 2x frequency so it must be done from a 1
priority interupt... any latency or skipped interrups will slightly alter
the
50/50 ratio for that period.
But doing it at 40x2 Mhz forget it !
A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port
pin.... and that would take virtualy 100% of the processing power available.
I dunno about the dsPICs they may have something on chip that can generate
such signals but I doubt it.
My best guess is that you should go for external circutry. A serially / SPI
controlled PLL RF generator / RF synteziser chip should do the job nicely...
maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of
band switching if using LC tuning. If you can find a chip that uses RC
tuning
you should get a much larger range, maybe even avoiding band switching
altogether.
http://hem.passagen.se/communication/rfinject.html
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1257
http://www.sxlist.com/images/www/hobby_elec/e_ckt15.htm
http://www.datasheetcatalog.org/datasheet/philips/TEA6100.pdf
ray xu wrote:
I just have a simple question dealing with the dsPIC30F2010. Is it possible
to generate an adjustable frequency square wave (from 1MHz to 40MHz)
directly out of the chip? Just in case you didn?t know, I have no
experience with the PIC. I am driving the PIC at 40MHz. Thanks.
____________ _______
Ray Xu
r...@tx.rr. com
DPRG member
OOPic group member
Seattle Robotics group member
My Blog
--
*******************************************
VISIT MY HOME PAGE:
LAST UPDATED: 23/08/2003
*******************************************
Regards
Eirik Karlsen
------------------------------------
to unsubscribe, go to http://www.yahoogroups.com and follow the
instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - "John J. McDonough, WB8RCR" - Sep 13 12:02:03 2008
There is a kind of an uh-oh in the datasheet. You need to read the fine
print. It says you can use a 0-40 MHz external oscillator with the PLL, but
in the footnote, it tells you that you must adhere to the 120 MHz max
internal clock speed. So with a 40 MHz external oscillator, the best you
can do is 10 MIPS (40 MHz). The external oscillator situation is a little
better than a crystal, since the max crystal is 10 MHz with the PLL. But in
both cases, you can reach 30 MIPS. With an external oscillator you have
more choices in how to get there. If you look at the table it appears you
can use a 40 MHz oscillator with the PLL, but in fact, all the PLL
multipliers result in an internal clock that is too high. So in practice,
the max oscillator is 7.5 MHz with the 16x PLL, 15 with 8x, and 30 with 4x.
You can multiply the oscillator or crystal by 1, 4, 8 or 16 (depending on
the particular dsPIC model), but the result may not be over 120 MHz. So, 30
MHz X 4 will get you 120 MHz clock or 30 MIPS with an external oscillator.
With a crystal, you cannot exceed a 10 MHz crystal with the PLL, so the
"fastest" crystal turns out to be 7.5 MHz X 16 for 30 MIPS.
72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
----- Original Message -----
From: "ray xu"
To:
Sent: Saturday, September 13, 2008 11:12 AM
Subject: RE: [piclist] generating square waves
> So if I want to achieve 30MIPS, I would need to over-clock it (is that
> even
> possible)? I looked on the datasheet; it says I can achieve 30MIPS with
> 40MHz external clock source.
>
> Also, what is the maximum frequency that the internal oscillator can
> output
> for the 32-bit timer?
>
> ___________________
> Ray Xu
> r...@tx.rr.com
> DPRG member
> OOPic group member
> Seattle Robotics group member
> My Blog
> -----Original Message-----
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf
> Of
> John J. McDonough, WB8RCR
> Sent: Saturday, September 13, 2008 10:05 AM
> To: p...@yahoogroups.com
> Subject: Re: [piclist] generating square waves
>
> To get 30 MIPS you need to run the 30F at 120 MHz (which it will do ...
> 7.5
> MHz X 16). I don't think you can use a 30 MHz crystal, I think that may
> still be limited to 20, I'm a little fuzzy on that. But crystals above 10
> can only be multiplied by 1, so a 10 MHz crystal X 4 (10 MIPS) is a better
> deal than 30 X 1 (7.5 MIPS). Even a 4 MHz rock will get you to 16 MIPS.
>
> 72/73 de WB8RCR http://www.qsl.net/wb8rcr
> didileydadidah QRP-L #1446 Code Warriors #35
>
> ----- Original Message -----
> From: ray xu
> To: p...@yahoogroups.com
> Sent: Saturday, September 13, 2008 10:33 AM
> Subject: RE: [piclist] generating square waves
> So is it possible to only use a PWM register (and no timers) to let it
> make
> a square waveform? If I were o do it like this, would it be able to
> generate a maximum of 30MHz (MIPS is 30 too)?
>
> ___________________
> Ray Xu
> r...@tx.rr.com
> DPRG member
> OOPic group member
> Seattle Robotics group member
> My Blog
> -----Original Message-----
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf
> Of
> Jan Didden / Linear Audio
> Sent: Saturday, September 13, 2008 7:52 AM
> To: p...@yahoogroups.com
> Subject: RE: [piclist] generating square waves
>
> Yes, you can use one of the CCP or PWM registers, set up a timer with the
> freq you want and let it run. Takes virtually zero processing power.
>
> Jan Didden
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf
> Of
> Michael Harpe
> Sent: Saturday, September 13, 2008 2:21 PM
> To: p...@yahoogroups.com
> Subject: Re: [piclist] generating square waves
> I thought using one of the timers was the preferred way to generate a
> waveform on a pin.
>
> Mike Harpe
>
> --- On Sat, 9/13/08, Eirik Karlsen wrote:
> From: Eirik Karlsen
> Subject: Re: [piclist] generating square waves
> To: p...@yahoogroups.com
> Date: Saturday, September 13, 2008, 5:25 AM
> Yes, and no....
> Generating a square wave is maybe best done by togeling a port pin at
> double
>
> the frequency, this will give you a square (50/50 mark space) wave.
> You'll have to do this at a steady 2x frequency so it must be done from a
> 1
> priority interupt... any latency or skipped interrups will slightly alter
> the
> 50/50 ratio for that period.
> But doing it at 40x2 Mhz forget it !
> A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port
> pin.... and that would take virtualy 100% of the processing power
> available.
> I dunno about the dsPICs they may have something on chip that can generate
> such signals but I doubt it.
> My best guess is that you should go for external circutry. A serially /
> SPI
> controlled PLL RF generator / RF synteziser chip should do the job
> nicely...
> maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of
> band switching if using LC tuning. If you can find a chip that uses RC
> tuning
> you should get a much larger range, maybe even avoiding band switching
> altogether.
> http://hem.passagen.se/communication/rfinject.html
> http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1257
> http://www.sxlist.com/images/www/hobby_elec/e_ckt15.htm
> http://www.datasheetcatalog.org/datasheet/philips/TEA6100.pdf
> ray xu wrote:
> I just have a simple question dealing with the dsPIC30F2010. Is it
> possible
>
> to generate an adjustable frequency square wave (from 1MHz to 40MHz)
> directly out of the chip? Just in case you didn?t know, I have no
> experience with the PIC. I am driving the PIC at 40MHz. Thanks.
> ____________ _______
> Ray Xu
> r...@tx.rr. com
> DPRG member
> OOPic group member
> Seattle Robotics group member
> My Blog
>
> --
> *******************************************
> VISIT MY HOME PAGE:
>
> LAST UPDATED: 23/08/2003
> *******************************************
> Regards
> Eirik Karlsen
> ------------------------------------
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - ray xu - Sep 13 12:26:56 2008
Putting it in fine print is pretty lame... So if I set the PLL to x16 and
use a 7.5MHz oscillator, the dsPIC would be operating at 120MHz and 30MIPS?
Anyways, is there anyway to figure out what would be the maximum internal
clock source for the 32-bit timer? Thanks.
___________________
Ray Xu
r...@tx.rr.com
DPRG member
OOPic group member
Seattle Robotics group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
John J. McDonough, WB8RCR
Sent: Saturday, September 13, 2008 11:02 AM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
There is a kind of an uh-oh in the datasheet. You need to read the fine
print. It says you can use a 0-40 MHz external oscillator with the PLL, but
in the footnote, it tells you that you must adhere to the 120 MHz max
internal clock speed. So with a 40 MHz external oscillator, the best you
can do is 10 MIPS (40 MHz). The external oscillator situation is a little
better than a crystal, since the max crystal is 10 MHz with the PLL. But in
both cases, you can reach 30 MIPS. With an external oscillator you have
more choices in how to get there. If you look at the table it appears you
can use a 40 MHz oscillator with the PLL, but in fact, all the PLL
multipliers result in an internal clock that is too high. So in practice,
the max oscillator is 7.5 MHz with the 16x PLL, 15 with 8x, and 30 with 4x.
You can multiply the oscillator or crystal by 1, 4, 8 or 16 (depending on
the particular dsPIC model), but the result may not be over 120 MHz. So, 30
MHz X 4 will get you 120 MHz clock or 30 MIPS with an external oscillator.
With a crystal, you cannot exceed a 10 MHz crystal with the PLL, so the
"fastest" crystal turns out to be 7.5 MHz X 16 for 30 MIPS.
72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
----- Original Message -----
From: "ray xu"
To:
Sent: Saturday, September 13, 2008 11:12 AM
Subject: RE: [piclist] generating square waves
> So if I want to achieve 30MIPS, I would need to over-clock it (is that
> even
> possible)? I looked on the datasheet; it says I can achieve 30MIPS with
> 40MHz external clock source.
>
> Also, what is the maximum frequency that the internal oscillator can
> output
> for the 32-bit timer?
>
> ___________________
> Ray Xu
> r...@tx.rr.com
> DPRG member
> OOPic group member
> Seattle Robotics group member
> My Blog
> -----Original Message-----
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf
> Of
> John J. McDonough, WB8RCR
> Sent: Saturday, September 13, 2008 10:05 AM
> To: p...@yahoogroups.com
> Subject: Re: [piclist] generating square waves
>
> To get 30 MIPS you need to run the 30F at 120 MHz (which it will do ...
> 7.5
> MHz X 16). I don't think you can use a 30 MHz crystal, I think that may
> still be limited to 20, I'm a little fuzzy on that. But crystals above 10
> can only be multiplied by 1, so a 10 MHz crystal X 4 (10 MIPS) is a better
> deal than 30 X 1 (7.5 MIPS). Even a 4 MHz rock will get you to 16 MIPS.
>
> 72/73 de WB8RCR http://www.qsl.net/wb8rcr
> didileydadidah QRP-L #1446 Code Warriors #35
>
> ----- Original Message -----
> From: ray xu
> To: p...@yahoogroups.com
> Sent: Saturday, September 13, 2008 10:33 AM
> Subject: RE: [piclist] generating square waves
> So is it possible to only use a PWM register (and no timers) to let it
> make
> a square waveform? If I were o do it like this, would it be able to
> generate a maximum of 30MHz (MIPS is 30 too)?
>
> ___________________
> Ray Xu
> r...@tx.rr.com
> DPRG member
> OOPic group member
> Seattle Robotics group member
> My Blog
> -----Original Message-----
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf
> Of
> Jan Didden / Linear Audio
> Sent: Saturday, September 13, 2008 7:52 AM
> To: p...@yahoogroups.com
> Subject: RE: [piclist] generating square waves
>
> Yes, you can use one of the CCP or PWM registers, set up a timer with the
> freq you want and let it run. Takes virtually zero processing power.
>
> Jan Didden
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf
> Of
> Michael Harpe
> Sent: Saturday, September 13, 2008 2:21 PM
> To: p...@yahoogroups.com
> Subject: Re: [piclist] generating square waves
> I thought using one of the timers was the preferred way to generate a
> waveform on a pin.
>
> Mike Harpe
>
> --- On Sat, 9/13/08, Eirik Karlsen wrote:
> From: Eirik Karlsen
> Subject: Re: [piclist] generating square waves
> To: p...@yahoogroups.com
> Date: Saturday, September 13, 2008, 5:25 AM
> Yes, and no....
> Generating a square wave is maybe best done by togeling a port pin at
> double
>
> the frequency, this will give you a square (50/50 mark space) wave.
> You'll have to do this at a steady 2x frequency so it must be done from a
> 1
> priority interupt... any latency or skipped interrups will slightly alter
> the
> 50/50 ratio for that period.
> But doing it at 40x2 Mhz forget it !
> A rough estimate for eg a PIC18 running at 40Mhz is 0.5 - 1Mhz at the port
> pin.... and that would take virtualy 100% of the processing power
> available.
> I dunno about the dsPICs they may have something on chip that can generate
> such signals but I doubt it.
> My best guess is that you should go for external circutry. A serially /
> SPI
> controlled PLL RF generator / RF synteziser chip should do the job
> nicely...
> maybe even down to 1Hz resolution. For a range of 1:40 expect some sort of
> band switching if using LC tuning. If you can find a chip that uses RC
> tuning
> you should get a much larger range, maybe even avoiding band switching
> altogether.
> http://hem.passagen.se/communication/rfinject.html
> http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1257
> http://www.sxlist.com/images/www/hobby_elec/e_ckt15.htm
> http://www.datasheetcatalog.org/datasheet/philips/TEA6100.pdf
> ray xu wrote:
> I just have a simple question dealing with the dsPIC30F2010. Is it
> possible
>
> to generate an adjustable frequency square wave (from 1MHz to 40MHz)
> directly out of the chip? Just in case you didn?t know, I have no
> experience with the PIC. I am driving the PIC at 40MHz. Thanks.
> ____________ _______
> Ray Xu
> r...@tx.rr. com
> DPRG member
> OOPic group member
> Seattle Robotics group member
> My Blog
>
> --
> *******************************************
> VISIT MY HOME PAGE:
>
> LAST UPDATED: 23/08/2003
> *******************************************
> Regards
> Eirik Karlsen
> ------------------------------------
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - "John J. McDonough, WB8RCR" - Sep 13 14:01:14 2008
----- Original Message -----
From: "ray xu"
To:
Sent: Saturday, September 13, 2008 12:26 PM
Subject: RE: [piclist] generating square waves
> Putting it in fine print is pretty lame... So if I set the PLL to x16 and
> use a 7.5MHz oscillator, the dsPIC would be operating at 120MHz and
> 30MIPS?
Correct.
I'm not so sure it's "lame". The buffer circuitry for the oscillator is
capable of 40 MHz, which is what the table tells you. The maximum processor
clock is 120 MHz, the footnote simply remids you of that. I do have to say,
I would have picked it up more easily if the table told me the maximum
useable crystal/oscillator, but I guess the way it is does give you a little
more information.
> Anyways, is there anyway to figure out what would be the maximum internal
> clock source for the 32-bit timer? Thanks.
The 32 bit counters can be driven off the processor clock or an external
oscillator. When driven from the processor clock, the timer increments once
per INSTRUCTION cycle, so if the processor is running at 120 MHz the timer
increments at 30 MHz, potentially divided by the prescaler. I didn't find
the limits for the external input to the 32 bit timers, but I would think
that inputs much higher than 30 MHz would be hard to deal with, even if the
PIC could. The 16 bit timer external input seems to be limited to 50 kHz, so
the 32 bit might be the same.
By the way, if you don't absolutely need the DSP engine, you might consider
the 24H parts that give you a little extra gas. Same instruction set, most
of the peripherals are the same although the 24 has a couple of features the
30/33 lack.
72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
------------------------------------
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - ray xu - Sep 13 14:18:56 2008
That's all I need. Thanks again. I choose the DSP for it's high MIPS,
since I am trying to make a programmable delay chip and because it operates
at 5V; I cannot use parts that operate on 3.3V.
___________________
Ray Xu
r...@tx.rr.com
DPRG
member
OOPic group member
Seattle Robotics
group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
John J. McDonough, WB8RCR
Sent: Saturday, September 13, 2008 1:01 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
----- Original Message -----
From: "ray xu" com>
To: .com>
Sent: Saturday, September 13, 2008 12:26 PM
Subject: RE: [piclist] generating square waves
> Putting it in fine print is pretty lame... So if I set the PLL to x16 and
> use a 7.5MHz oscillator, the dsPIC would be operating at 120MHz and
> 30MIPS?
Correct.
I'm not so sure it's "lame". The buffer circuitry for the oscillator is
capable of 40 MHz, which is what the table tells you. The maximum processor
clock is 120 MHz, the footnote simply remids you of that. I do have to say,
I would have picked it up more easily if the table told me the maximum
useable crystal/oscillator, but I guess the way it is does give you a little
more information.
> Anyways, is there anyway to figure out what would be the maximum internal
> clock source for the 32-bit timer? Thanks.
The 32 bit counters can be driven off the processor clock or an external
oscillator. When driven from the processor clock, the timer increments once
per INSTRUCTION cycle, so if the processor is running at 120 MHz the timer
increments at 30 MHz, potentially divided by the prescaler. I didn't find
the limits for the external input to the 32 bit timers, but I would think
that inputs much higher than 30 MHz would be hard to deal with, even if the
PIC could. The 16 bit timer external input seems to be limited to 50 kHz, so
the 32 bit might be the same.
By the way, if you don't absolutely need the DSP engine, you might consider
the 24H parts that give you a little extra gas. Same instruction set, most
of the peripherals are the same although the 24 has a couple of features the
30/33 lack.
72/73 de WB8RCR http://www.qsl. net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - Michael Harpe - Sep 13 14:58:12 2008
Since you want such a fast clock, another option might be to use an external oscillator at
the right frequency. Drive the MCU and whatever needs 30 MHz with the external
oscillator.
Mike Harpe
--- On Sat, 9/13/08, Jan Didden / Linear Audio
wrote:
From: Jan Didden / Linear Audio
Subject: RE: [piclist] generating square waves
To: p...@yahoogroups.com
Date: Saturday, September 13, 2008, 10:52 AM
I think it uses one of the available timers, like in
the 16F685 I used it uses T2. But once you set up all the registers, it runs
without any further intervention. You would have to check the data sheet for
your chip.
For a 40Mhz clock I think the max freq would be 10MHz,
but, again, check the data sheet for details. There is always a detailed
description of the PWM functionality.
Jan Didden
From: p...@yahoogroups.com
[mailto:p...@yahoogroups.com] On Behalf Of ray xu
Sent:
Saturday, September 13, 2008 4:33 PM
To:
p...@yahoogroups.com
Subject: RE: [piclist] generating square
waves
So is it possible to
only use a PWM register (and no timers) to let it make a square waveform?
If I were o do it like this, would it be able to generate a maximum of 30MHz
(MIPS is 30 too)?
____________ _______
Ray
Xu
r...@tx.rr. com
DPRG member
OOPic group
member
Seattle Robotics group member
My
Blog
-----Original
Message-----
From:
piclist@yahoogroups .com
[mailto:piclist@yahoogroups .com] On Behalf Of Jan Didden / Linear
Audio
Sent: Saturday, September
13, 2008 7:52 AM
To:
piclist@yahoogroups .com
Subject: RE: [piclist] generating square
waves
Yes, you can use one
of the CCP or PWM registers, set up a timer with the freq you want and let it
run. Takes virtually zero processing power.
Jan
Didden
From:
piclist@yahoogroups .com [mailto:piclist@ yahoogroups. com] On Behalf Of Michael Harpe
Sent: Saturday, September 13, 2008 2:21
PM
To:
piclist@yahoogroups .com
Subject: Re: [piclist] generating square
waves
I thought using one of the timers was the
preferred way to generate a waveform on a pin.
Mike
Harpe
--- On Sat, 9/13/08, Eirik
Karlsen
wrote:
From: Eirik Karlsen
Subject: Re: [piclist] generating
square waves
To: piclist@yahoogroups .com
Date: Saturday,
September 13, 2008, 5:25 AM
Yes, and no....
Generating a square wave is maybe best done by
togeling a port pin at double the frequency, this will give you a square
(50/50 mark space) wave.
You'll have to do this at a steady 2x
frequency so it must be done from a 1 priority interupt... any latency or
skipped interrups will slightly alter the
50/50 ratio for that period.
But
doing it at 40x2 Mhz forget it !
A rough estimate for eg a PIC18
running at 40Mhz is 0.5 - 1Mhz at the port pin.... and that would take
virtualy 100% of the processing power available.
I
dunno about the dsPICs they may have something on chip that can generate
such signals but I doubt it.
My
best guess is that you should go for external circutry. A serially / SPI
controlled PLL RF generator / RF synteziser chip should do the job
nicely...
maybe even down to 1Hz resolution. For a range of 1:40
expect some sort of band switching if using LC tuning. If you can find a
chip that uses RC tuning
you should get a much larger range, maybe
even avoiding band switching altogether.
http://hem.passagen .se/communicatio n/rfinject. html
http://www.maxim- ic.com/quick_ view2.cfm/ qv_pk/1257
http://www.sxlist. com/images/ www/hobby_ elec/e_ckt15. htm
http://www.datashee tcatalog. org/datasheet/ philips/TEA6100. pdf
ray
xu wrote:
I just have a simple
question dealing with the dsPIC30F2010. Is it possible to generate
an adjustable frequency square wave (from 1MHz to 40MHz) directly out of
the chip? Just in case you didnąt know, I have no experience with
the PIC. I am driving the PIC at 40MHz.
Thanks.
____________ _______
Ray
Xu
r...@tx.rr. com
DPRG member
OOPic group member
Seattle Robotics group member
My
Blog
--
************ ********* ********* ********* ****
VISIT MY HOME PAGE:
LAST UPDATED: 23/08/2003
************ ********* ********* ********* ****
Regards
Eirik Karlsen

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - ray xu - Sep 13 23:44:12 2008
So the counter will increment (at 30MHz) regardless of how many code there
is in the program? I'm guessing that the increment per cycle has something
to do with the 30MIPS.
___________________
Ray Xu
r...@tx.rr.com
DPRG
member
OOPic group member
Seattle Robotics
group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
John J. McDonough, WB8RCR
Sent: Saturday, September 13, 2008 1:01 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
----- Original Message -----
From: "ray xu" com>
To: .com>
Sent: Saturday, September 13, 2008 12:26 PM
Subject: RE: [piclist] generating square waves
> Putting it in fine print is pretty lame... So if I set the PLL to x16 and
> use a 7.5MHz oscillator, the dsPIC would be operating at 120MHz and
> 30MIPS?
Correct.
I'm not so sure it's "lame". The buffer circuitry for the oscillator is
capable of 40 MHz, which is what the table tells you. The maximum processor
clock is 120 MHz, the footnote simply remids you of that. I do have to say,
I would have picked it up more easily if the table told me the maximum
useable crystal/oscillator, but I guess the way it is does give you a little
more information.
> Anyways, is there anyway to figure out what would be the maximum internal
> clock source for the 32-bit timer? Thanks.
The 32 bit counters can be driven off the processor clock or an external
oscillator. When driven from the processor clock, the timer increments once
per INSTRUCTION cycle, so if the processor is running at 120 MHz the timer
increments at 30 MHz, potentially divided by the prescaler. I didn't find
the limits for the external input to the 32 bit timers, but I would think
that inputs much higher than 30 MHz would be hard to deal with, even if the
PIC could. The 16 bit timer external input seems to be limited to 50 kHz, so
the 32 bit might be the same.
By the way, if you don't absolutely need the DSP engine, you might consider
the 24H parts that give you a little extra gas. Same instruction set, most
of the peripherals are the same although the 24 has a couple of features the
30/33 lack.
72/73 de WB8RCR http://www.qsl. net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: generating square waves - Jan Didden / Linear Audio - Sep 14 3:57:44 2008
Assuming you're still talking about the PWM module, once set-up, that runs
separate from whatever other things you do in your code. The PWM can be
considered in this context as a separate piece of hardware that you set up,
let it run and then you go back to your program to do whatever evil things
you want ;-)
Jan Didden
pic l...@yahoogroups.com
[mailto:p...@yahoogroups.com] On Behalf Of ray xu
Sent: Sunday, September 14, 2008 5:44 AM
To: p...@yahoogroups.com
Subject: RE: [piclist] generating square waves
So the counter will increment (at 30MHz) regardless of how many code there
is in the program? I'm guessing that the increment per cycle has something
to do with the 30MIPS.
___________________
Ray Xu
r...@tx.rr. com
DPRG member
OOPic group member
Seattle Robotics
group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
John J. McDonough, WB8RCR
Sent: Saturday, September 13, 2008 1:01 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
----- Original Message -----
From: "ray xu" com>
To: .com>
Sent: Saturday, September 13, 2008 12:26 PM
Subject: RE: [piclist] generating square waves
> Putting it in fine print is pretty lame... So if I set the PLL to x16 and
> use a 7.5MHz oscillator, the dsPIC would be operating at 120MHz and
> 30MIPS?
Correct.
I'm not so sure it's "lame". The buffer circuitry for the oscillator is
capable of 40 MHz, which is what the table tells you. The maximum processor
clock is 120 MHz, the footnote simply remids you of that. I do have to say,
I would have picked it up more easily if the table told me the maximum
useable crystal/oscillator, but I guess the way it is does give you a little
more information.
> Anyways, is there anyway to figure out what would be the maximum internal
> clock source for the 32-bit timer? Thanks.
The 32 bit counters can be driven off the processor clock or an external
oscillator. When driven from the processor clock, the timer increments once
per INSTRUCTION cycle, so if the processor is running at 120 MHz the timer
increments at 30 MHz, potentially divided by the prescaler. I didn't find
the limits for the external input to the 32 bit timers, but I would think
that inputs much higher than 30 MHz would be hard to deal with, even if the
PIC could. The 16 bit timer external input seems to be limited to 50 kHz, so
the 32 bit might be the same.
By the way, if you don't absolutely need the DSP engine, you might consider
the 24H parts that give you a little extra gas. Same instruction set, most
of the peripherals are the same although the 24 has a couple of features the
30/33 lack.
72/73 de WB8RCR http://www.qsl. net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - "John J. McDonough, WB8RCR" - Sep 14 11:30:28 2008
----- Original Message -----
From: ray xu
To: p...@yahoogroups.com
Sent: Saturday, September 13, 2008 11:44 PM
Subject: RE: [piclist] generating square waves
> So the counter will increment (at 30MHz) regardless of how many
> code there is in the program?
That's the whole point of the timer. It allows you to keep track without
counting instructions.
> I'm guessing that the increment per cycle has something to
> do with the 30MIPS.
Look at the block diagram. The processor clock feeds the timer trhough the
prescaler, so you have choices. If I recall, not all dsPICs have the same
prescaler options available, and you haven't revealed which dsPIC you are
considering. But on the 30F401x, if you are running the processor clock at
120 MHz, the instruction rate is 30 MHz, so the timer options are 30 MHz,
3.75 MHz, 468.75 kHz, and 117.1875 kHz.
72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
___________________
Ray Xu
r...@tx.rr.com
DPRG member
OOPic group member
Seattle Robotics group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
John J. McDonough, WB8RCR
Sent: Saturday, September 13, 2008 1:01 PM
To: p...@yahoogroups.com
Subject: Re: [piclist] generating square waves
----- Original Message -----
From: "ray xu"
To:
Sent: Saturday, September 13, 2008 12:26 PM
Subject: RE: [piclist] generating square waves
> Putting it in fine print is pretty lame... So if I set the PLL to x16 and
> use a 7.5MHz oscillator, the dsPIC would be operating at 120MHz and
> 30MIPS?
Correct.
I'm not so sure it's "lame". The buffer circuitry for the oscillator is
capable of 40 MHz, which is what the table tells you. The maximum processor
clock is 120 MHz, the footnote simply remids you of that. I do have to say,
I would have picked it up more easily if the table told me the maximum
useable crystal/oscillator, but I guess the way it is does give you a little
more information.
> Anyways, is there anyway to figure out what would be the maximum internal
> clock source for the 32-bit timer? Thanks.
The 32 bit counters can be driven off the processor clock or an external
oscillator. When driven from the processor clock, the timer increments once
per INSTRUCTION cycle, so if the processor is running at 120 MHz the timer
increments at 30 MHz, potentially divided by the prescaler. I didn't find
the limits for the external input to the 32 bit timers, but I would think
that inputs much higher than 30 MHz would be hard to deal with, even if the
PIC could. The 16 bit timer external input seems to be limited to 50 kHz, so
the 32 bit might be the same.
By the way, if you don't absolutely need the DSP engine, you might consider
the 24H parts that give you a little extra gas. Same instruction set, most
of the peripherals are the same although the 24 has a couple of features the
30/33 lack.
72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
------------------------------------
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - James - Sep 14 19:13:17 2008
Its worth remembering the information in the datasheets is for
reference only, not necessarily the absolute maximum or minimum. I
heard stories from Microchip Corporation personal at a seminar that
some folks have taken it upon themselves to overclock uCs. Generally
the processor just starts to get warm and eventually overheat. To what
degree it overheats is a question. If you try this just monitor the
temperature of the chip. And never run a uC over clocked with an
onboard ethernet interface as it generates a great deal of heat on its
own. As long as you do not go too close to the temperature that the
junction will break you should be good.
Cheers,
James
------------------------------------
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )
RE: Re: generating square waves - ray xu - Sep 14 19:48:54 2008
BTW, I couldn't find any exact 7.5MHz crystals, oscillators, etc. I just
noticed that the internal oscillator is 7.5MHz, but I don't know what is the
type name for it in MPLAB (EX, XT, etc.) and if it is supported by the PLL.
Would 7.5MHz with 16x PLL be considered over clocking? Is over clocking a
bad or a good thing? I'm thinking of putting a heatsink on my PICs now just
in case.
___________________
Ray Xu
r...@tx.rr.com
DPRG
member
OOPic group member
Seattle Robotics
group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
James
Sent: Sunday, September 14, 2008 6:13 PM
To: p...@yahoogroups.com
Subject: [piclist] Re: generating square waves
Its worth remembering the information in the datasheets is for
reference only, not necessarily the absolute maximum or minimum. I
heard stories from Microchip Corporation personal at a seminar that
some folks have taken it upon themselves to overclock uCs. Generally
the processor just starts to get warm and eventually overheat. To what
degree it overheats is a question. If you try this just monitor the
temperature of the chip. And never run a uC over clocked with an
onboard ethernet interface as it generates a great deal of heat on its
own. As long as you do not go too close to the temperature that the
junction will break you should be good.
Cheers,
James

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - James - Sep 15 0:11:26 2008
Ray,
I wouldn't worry about heatsinking all of your PICs. Chances are if it
starts heating up you are running at way too high a frequency,
ethernet module running (heating is normal), all outputs high,
overclocking, or made the mistake of inverting the polarity of the
power supply (its obvious when smoke shoots out, oops). What ever the
case is I wouldn't worry about installing heatsinks because if one is
required something is going very wrong.
As far as using running the 7.5MHz clock with the 16x PLL you should
be fine. The data sheet said the processor is capable of 30MIPS. Keep
in mind that every machine cycle (instruction) actually takes 4 clock
cycles. (7.5MHz*16=120MHz) (120MHz/4(cycles/instruction)=30,000,000
instructions). My suggestion is that if you want to go into test pilot
territory go for it. Just keep an eye on that oscilloscope for
anything odd and monitor the processor temp. I recommend using an
external function generator as your clock input.
Good luck,
James
--- In p...@yahoogroups.com, "ray xu"
wrote:
>
> BTW, I couldn't find any exact 7.5MHz crystals, oscillators, etc. I
just
> noticed that the internal oscillator is 7.5MHz, but I don't know
what is the
> type name for it in MPLAB (EX, XT, etc.) and if it is supported by
the PLL.
>
>
> Would 7.5MHz with 16x PLL be considered over clocking? Is over
clocking a
> bad or a good thing? I'm thinking of putting a heatsink on my PICs
now just
> in case.
>
>
>
> ___________________
> Ray Xu
> rayxu@...
> DPRG member
> OOPic group member
> Seattle Robotics
> group member
> My Blog -----Original Message-----
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On
Behalf Of
> James
> Sent: Sunday, September 14, 2008 6:13 PM
> To: p...@yahoogroups.com
> Subject: [piclist] Re: generating square waves
>
>
>
> Its worth remembering the information in the datasheets is for
> reference only, not necessarily the absolute maximum or minimum. I
> heard stories from Microchip Corporation personal at a seminar that
> some folks have taken it upon themselves to overclock uCs. Generally
> the processor just starts to get warm and eventually overheat. To what
> degree it overheats is a question. If you try this just monitor the
> temperature of the chip. And never run a uC over clocked with an
> onboard ethernet interface as it generates a great deal of heat on its
> own. As long as you do not go too close to the temperature that the
> junction will break you should be good.
>
> Cheers,
> James
>
------------------------------------
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: Re: generating square waves - ray xu - Sep 15 21:31:31 2008
Also, I couldn't find any 7.5MHz clock sources, so which type (XT, LP, etc.)
of oscillator configuration would be for the internal oscillator (7.5MHz)
with 16x? Thanks.
___________________
Ray Xu
r...@tx.rr.com
DPRG
member
OOPic group member
Seattle Robotics
group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
James
Sent: Sunday, September 14, 2008 11:11 PM
To: p...@yahoogroups.com
Subject: [piclist] Re: generating square waves
Ray,
I wouldn't worry about heatsinking all of your PICs. Chances are if it
starts heating up you are running at way too high a frequency,
ethernet module running (heating is normal), all outputs high,
overclocking, or made the mistake of inverting the polarity of the
power supply (its obvious when smoke shoots out, oops). What ever the
case is I wouldn't worry about installing heatsinks because if one is
required something is going very wrong.
As far as using running the 7.5MHz clock with the 16x PLL you should
be fine. The data sheet said the processor is capable of 30MIPS. Keep
in mind that every machine cycle (instruction) actually takes 4 clock
cycles. (7.5MHz*16=120MHz) (120MHz/4(cycles/instruction)=30,000,000
instructions). My suggestion is that if you want to go into test pilot
territory go for it. Just keep an eye on that oscilloscope for
anything odd and monitor the processor temp. I recommend using an
external function generator as your clock input.
Good luck,
James
--- In piclist@yahoogroups .com, "ray xu"
wrote:
>
> BTW, I couldn't find any exact 7.5MHz crystals, oscillators, etc. I
just
> noticed that the internal oscillator is 7.5MHz, but I don't know
what is the
> type name for it in MPLAB (EX, XT, etc.) and if it is supported by
the PLL.
> Would 7.5MHz with 16x PLL be considered over clocking? Is over
clocking a
> bad or a good thing? I'm thinking of putting a heatsink on my PICs
now just
> in case.
>
> ___________________
> Ray Xu
> rayxu@...
> DPRG org> member
> OOPic
groups.yahoo.com/group/oopic/> group member
> Seattle
groups.yahoo.com/group/SeattleRobotics/> Robotics
> group member
> My Blog
blogspot.com/> -----Original Message-----
> From: piclist@yahoogroups .com
[mailto:piclist@yahoogroups .com] On
Behalf Of
> James
> Sent: Sunday, September 14, 2008 6:13 PM
> To: piclist@yahoogroups .com
> Subject: [piclist] Re: generating square waves
>
> Its worth remembering the information in the datasheets is for
> reference only, not necessarily the absolute maximum or minimum. I
> heard stories from Microchip Corporation personal at a seminar that
> some folks have taken it upon themselves to overclock uCs. Generally
> the processor just starts to get warm and eventually overheat. To what
> degree it overheats is a question. If you try this just monitor the
> temperature of the chip. And never run a uC over clocked with an
> onboard ethernet interface as it generates a great deal of heat on its
> own. As long as you do not go too close to the temperature that the
> junction will break you should be good.
>
> Cheers,
> James
>

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )RE: Re: generating square waves - ray xu - Sep 15 21:38:51 2008
(Sorry for this continued post) Also, is it possible that I can just
overclock it a little (7.6MHz external with PLL 16x)? Or, use a 15MHz
oscillator with 8x PLL (The datasheet says maximum PLL input is 10MHz, I'm
not very sure about that.)?
___________________
Ray Xu
r...@tx.rr.com
DPRG
member
OOPic group member
Seattle Robotics
group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
James
Sent: Sunday, September 14, 2008 11:11 PM
To: p...@yahoogroups.com
Subject: [piclist] Re: generating square waves
Ray,
I wouldn't worry about heatsinking all of your PICs. Chances are if it
starts heating up you are running at way too high a frequency,
ethernet module running (heating is normal), all outputs high,
overclocking, or made the mistake of inverting the polarity of the
power supply (its obvious when smoke shoots out, oops). What ever the
case is I wouldn't worry about installing heatsinks because if one is
required something is going very wrong.
As far as using running the 7.5MHz clock with the 16x PLL you should
be fine. The data sheet said the processor is capable of 30MIPS. Keep
in mind that every machine cycle (instruction) actually takes 4 clock
cycles. (7.5MHz*16=120MHz) (120MHz/4(cycles/instruction)=30,000,000
instructions). My suggestion is that if you want to go into test pilot
territory go for it. Just keep an eye on that oscilloscope for
anything odd and monitor the processor temp. I recommend using an
external function generator as your clock input.
Good luck,
James
--- In piclist@yahoogroups .com, "ray xu"
wrote:
>
> BTW, I couldn't find any exact 7.5MHz crystals, oscillators, etc. I
just
> noticed that the internal oscillator is 7.5MHz, but I don't know
what is the
> type name for it in MPLAB (EX, XT, etc.) and if it is supported by
the PLL.
> Would 7.5MHz with 16x PLL be considered over clocking? Is over
clocking a
> bad or a good thing? I'm thinking of putting a heatsink on my PICs
now just
> in case.
>
> ___________________
> Ray Xu
> rayxu@...
> DPRG org> member
> OOPic
groups.yahoo.com/group/oopic/> group member
> Seattle
groups.yahoo.com/group/SeattleRobotics/> Robotics
> group member
> My Blog
blogspot.com/> -----Original Message-----
> From: piclist@yahoogroups .com
[mailto:piclist@yahoogroups .com] On
Behalf Of
> James
> Sent: Sunday, September 14, 2008 6:13 PM
> To: piclist@yahoogroups .com
> Subject: [piclist] Re: generating square waves
>
> Its worth remembering the information in the datasheets is for
> reference only, not necessarily the absolute maximum or minimum. I
> heard stories from Microchip Corporation personal at a seminar that
> some folks have taken it upon themselves to overclock uCs. Generally
> the processor just starts to get warm and eventually overheat. To what
> degree it overheats is a question. If you try this just monitor the
> temperature of the chip. And never run a uC over clocked with an
> onboard ethernet interface as it generates a great deal of heat on its
> own. As long as you do not go too close to the temperature that the
> junction will break you should be good.
>
> Cheers,
> James
>

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: Re: generating square waves - "John J. McDonough, WB8RCR" - Sep 15 21:53:58 2008
7.3728 crystals and resonators are widely available cheap. You can get ANY
crystal you want, but if you don't want a common value they get pricey.
I would be very surprised if you couldn't overclock most PICs a little,
maybe even a lot. *BUT*, I would expect that at some point they would fail
"a little", and that could be madddeningly difficult to debug. PICs are
amazingly durable little buggers, it seems like you have to work at it to
hurt them. But if you ran them too fast the first symptoms I would expect
would be memory cells not holding the right value once in a while, or the
occasional instruction misbehaving. Something like that could be impossible
to sort out what is going on.
By my reading of the datasheet, you are limited to 10 MHz for a crystal, but
not for an external oscillator, so that does give you a few more options.
But 118 MHz is mighty close to 120, at least close enough that I tend to not
be willing to go the long dollar for a 7.5000 MHz crystal. I haven't
actually priced one, but I would expect to pay $20-30 compared to 0.40 for a
7.3278 (Digikey X019), a little more if you want one of those nice CA301
packages (SER3413).
72/73 de WB8RCR http://www.qsl.net/wb8rcr
didileydadidah QRP-L #1446 Code Warriors #35
----- Original Message -----
From: ray xu
To: p...@yahoogroups.com
Sent: Monday, September 15, 2008 9:35 PM
Subject: RE: [piclist] Re: generating square waves
(Sorry for this continued post) Also, is it possible that I can just
overclock it a little (7.6MHz external with PLL 16x)? Or, use a 15MHz
oscillator with 8x PLL (The datasheet says maximum PLL input is 10MHz, I'm
not very sure about that.)?
___________________
Ray Xu
r...@tx.rr.com
DPRG member
OOPic group member
Seattle Robotics group member
My Blog
-----Original Message-----
From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On Behalf Of
James
Sent: Sunday, September 14, 2008 11:11 PM
To: p...@yahoogroups.com
Subject: [piclist] Re: generating square waves
Ray,
I wouldn't worry about heatsinking all of your PICs. Chances are if it
starts heating up you are running at way too high a frequency,
ethernet module running (heating is normal), all outputs high,
overclocking, or made the mistake of inverting the polarity of the
power supply (its obvious when smoke shoots out, oops). What ever the
case is I wouldn't worry about installing heatsinks because if one is
required something is going very wrong.
As far as using running the 7.5MHz clock with the 16x PLL you should
be fine. The data sheet said the processor is capable of 30MIPS. Keep
in mind that every machine cycle (instruction) actually takes 4 clock
cycles. (7.5MHz*16=120MHz) (120MHz/4(cycles/instruction)=30,000,000
instructions). My suggestion is that if you want to go into test pilot
territory go for it. Just keep an eye on that oscilloscope for
anything odd and monitor the processor temp. I recommend using an
external function generator as your clock input.
Good luck,
James
--- In p...@yahoogroups.com, "ray xu"
wrote:
>
> BTW, I couldn't find any exact 7.5MHz crystals, oscillators, etc. I
just
> noticed that the internal oscillator is 7.5MHz, but I don't know
what is the
> type name for it in MPLAB (EX, XT, etc.) and if it is supported by
the PLL.
> Would 7.5MHz with 16x PLL be considered over clocking? Is over
clocking a
> bad or a good thing? I'm thinking of putting a heatsink on my PICs
now just
> in case.
>
> ___________________
> Ray Xu
> rayxu@...
> DPRG member
> OOPic group member
> Seattle Robotics
> group member
> My Blog -----Original Message-----
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On
Behalf Of
> James
> Sent: Sunday, September 14, 2008 6:13 PM
> To: p...@yahoogroups.com
> Subject: [piclist] Re: generating square waves
>
> Its worth remembering the information in the datasheets is for
> reference only, not necessarily the absolute maximum or minimum. I
> heard stories from Microchip Corporation personal at a seminar that
> some folks have taken it upon themselves to overclock uCs. Generally
> the processor just starts to get warm and eventually overheat. To what
> degree it overheats is a question. If you try this just monitor the
> temperature of the chip. And never run a uC over clocked with an
> onboard ethernet interface as it generates a great deal of heat on its
> own. As long as you do not go too close to the temperature that the
> junction will break you should be good.
>
> Cheers,
> James
>
------------------------------------
to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )Re: generating square waves - Csaba Zvekan - Sep 17 17:54:03 2008
You could also use a CPLD and clock it with 30MHz to get your PWM.
Look into a XC9536 for instance.
The PICs are obviously quiet limited in Speed but have other
advantages: the cool peripherals . :)
Csaba
On Sep 14, 2008, at 5:44 AM, ray xu wrote:
>
> So the counter will increment (at 30MHz) regardless of how many code
> there is in the program? Im guessing that the increment per cycle
> has something to do with the 30MIPS
> ___________________
> Ray Xu
> r...@tx.rr.com
> DPRG member
> OOPic group member
> Seattle Robotics group member
> My Blog
>
> -----Original Message-----
> From: p...@yahoogroups.com [mailto:p...@yahoogroups.com] On
> Behalf Of John J. McDonough, WB8RCR
> Sent: Saturday, September 13, 2008 1:01 PM
> To: p...@yahoogroups.com
> Subject: Re: [piclist] generating square waves
>
> ----- Original Message -----
> From: "ray xu"
> To:
> Sent: Saturday, September 13, 2008 12:26 PM
> Subject: RE: [piclist] generating square waves
>
> > Putting it in fine print is pretty lame... So if I set the PLL to
> x16 and
> > use a 7.5MHz oscillator, the dsPIC would be operating at 120MHz and
> > 30MIPS?
>
> Correct.
>
> I'm not so sure it's "lame". The buffer circuitry for the oscillator
> is
> capable of 40 MHz, which is what the table tells you. The maximum
> processor
> clock is 120 MHz, the footnote simply remids you of that. I do have
> to say,
> I would have picked it up more easily if the table told me the maximum
> useable crystal/oscillator, but I guess the way it is does give you
> a little
> more information.
>
> > Anyways, is there anyway to figure out what would be the maximum
> internal
> > clock source for the 32-bit timer? Thanks.
>
> The 32 bit counters can be driven off the processor clock or an
> external
> oscillator. When driven from the processor clock, the timer
> increments once
> per INSTRUCTION cycle, so if the processor is running at 120 MHz the
> timer
> increments at 30 MHz, potentially divided by the prescaler. I didn't
> find
> the limits for the external input to the 32 bit timers, but I would
> think
> that inputs much higher than 30 MHz would be hard to deal with, even
> if the
> PIC could. The 16 bit timer external input seems to be limited to 50
> kHz, so
> the 32 bit might be the same.
>
> By the way, if you don't absolutely need the DSP engine, you might
> consider
> the 24H parts that give you a little extra gas. Same instruction
> set, most
> of the peripherals are the same although the 24 has a couple of
> features the
> 30/33 lack.
>
> 72/73 de WB8RCR http://www.qsl.net/wb8rcr
> didileydadidah QRP-L #1446 Code Warriors #35

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )help sms command recognizing - eshezo ayomi - Sep 17 17:55:02 2008
Hi all
i want someone to help me with this.....
i am new to SMS world but i learn how to use the PIC to send and receive SMS ... (text
mode) i am preparing the code until the GSM is received from the seller...............
the idea now that i want to send a command to the PIC via SMS and read it .. so that if
it is a predefined command a programmed action will be done ....
i can simply send a command via SMS such as "ON" to the GSM connected to the PIC ....
but now when recieved to the PIC i have 2 problems which i need to solve them simply
....( iam not too good in programming...)
i am using PCW 3.148....
first of all i used to save the messages recieved through:
#int_rda
void serial_isr()
{
rx[i++] = getch();
}
the first problem is :
- How to know if there is a new received message ?
should i save the "+CNMI" in a variable such as : strcpy(s,"+CNMI")
and then compare it with the first 5 characters saved in "rx" ????
or no need for this step ????
so just try to read the first message in a loop until it is a command message?
- The second problem is :
How to know the command recieved?
is it right to put a symbole before the command such as "$" and search the message saved
in "rx" for that symbol and when find it ... try to know what is the characters followed
it such as :
strcpy(cmd,"$ON") // saving the command
x=0;
flag = 1; //flag
while(1)
{
data = rx[x]; // character by character
if (data =="$") // the symbole
{
for(i = x;i
if (rx[i] != cmd[i-x+1]) // ensure just to compare cmd[0],cmd[1]
flag = 0; //change the flage due to condition
......
...
and continue the code...............
hope you all help me .....
Eng. Huthaifa .A.Nabil
P Plz, consider your environmental responsibility.
B4 printing ask your self: 'Do I need a hard copy?'

(You need to be a member of piclist -- send a blank email to piclist-subscribe@yahoogroups.com )