Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ASK generation using pic microcontroller

Status
Not open for further replies.

biswajitdas49

Member level 3
Joined
May 17, 2012
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
WEST BENGAL,INDIA
Activity points
1,726
Hi,somebody know how to generate Amplitude Shift Keying using pic microcontroller? Is it possible ?
If yes then how? I don't want the code, I just want know the possible logic ?

If some body have the knowledge, please share with me?
It will be very helpful for me and maybe others!

Thanks!!!
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,920
Helped
4,874
Reputation
9,766
Reaction score
4,661
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
126,941
Yes it is possible.

If you want 100% amplitude keying, use the TRIS bit to make the pin an input or output. Input mode will generate no signal, output mode will generate 100% signal.

If you want less than 100% modulation there are several ways to do it:
1. If the PIC has a DAC, you can use it as a programmable potentiometer.
2. You can use a pin as a level switch, drive it low and use it's TRIS bit to ground the lower resistor in a potential divider. In other words switch the lower resistor in and out of circuit so it's effect as an attenuator is turned on and off.
3. If your signal is software generated you may be able to control it's amplitude by calculation.
4. If you use PWM you can generate an analog voltage which you can then use to control the amplitude.

Some PICs have built in signal modulators which you can use to advantage.

Brian.
 

biswajitdas49

Member level 3
Joined
May 17, 2012
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
WEST BENGAL,INDIA
Activity points
1,726
it should be possible using a DAC (digital to Analogue Converter)
generate a sine wave (from a look up table) and vary the amplitude to represent digital values
or you could use a DDS chip
https://en.wikipedia.org/wiki/Direct_digital_synthesizer

what frequency are you planing to transmit?

thanks for your reply!!
Actually I don't understand, how to calculate the carrier and the data frequency. Is there any formula or I can chose randomly carrier and the data frequency?
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,365
Helped
14,245
Reputation
28,751
Reaction score
12,931
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,954
"don't understand how to calculate"? I was thinking up to now that data rate and carrier frequency are commanded by the application. What's your application?
 

biswajitdas49

Member level 3
Joined
May 17, 2012
Messages
55
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
WEST BENGAL,INDIA
Activity points
1,726
"don't understand how to calculate"? I was thinking up to now that data rate and carrier frequency are commanded by the application. What's your application?

"don't understand how to calculate" means how to calculate the perfect carrier frequency for the particular data rate. my application is to make a simple RF transmitter which is based on pic micro-controller.
actually I try to make a ASK generator in proteus, there I found that phase of the carrier didn't match with the data bits,that's why I think is it possible to make ASK signal using microcontroller.
here is the circuit-
circuit.jpg simulate.jpg
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,365
Helped
14,245
Reputation
28,751
Reaction score
12,931
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,954
A PIC microcontroller can't generate RF frequencies beyond a few MHz.
 

betwixt

Super Moderator
Staff member
Joined
Jul 4, 2009
Messages
14,920
Helped
4,874
Reputation
9,766
Reaction score
4,661
Trophy points
1,393
Location
Aberdyfi, West Wales, UK
Activity points
126,941
All your schematic shows is an analog switch. You can generate the carrier and the modulation using any method you like. They do not have to be phase related although nothing stops you from syncing the modulation to the carrier if you want to.

The golden rule is the carrier must be at LEAST twice the modulation frequency (at least 2 cycles of carrier per bit), in practise it is best for it to be many times higher. As FvM points ut, the actual frequencies depend entirely on your aplication. For example, my TV remote control uses a 38KHz carrier and about 200 bits per second, one of my data links uses a 29GHz carrier and 27 Megabits per second modulation rate.

You probably don't want to generate the carrier from a PIC if the frequency is more than a few hundred KHz or you risk instability as your software takes different routes through your program. You should be fine generating data which normally isn't as critical of speed and at much slower rate.

Brian.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top