Continue to Site

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.

[SOLVED] How can i create at PWM using max232

Status
Not open for further replies.

novaflare

Newbie level 5
Joined
Oct 7, 2014
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
77
Hi people,

I am new in these area of microcontroller.

I needto use microcontroller to design a square wave of 50hz with a duty cycle of 50%

but first of all i have alot of qns hopefully you guys can help.

1) what program can i use to program my max232
2) if i can create the circuit on breadboard, how am i connecting the circuit to my pc to load the codes into the chip
3) is there other IC you would recommand instead of max232
4) please advice me if i have missed out anything

i have created the exact same circuit using a 555timer, but now i to use my pc to generate a freq instead of chaging the variable resistor on my 555timer circuit board
 

The MAX232 isn't a microcontroller and it isn't programmable. It is an RS232/TTL level converter and interface.

You can use many types of microcontroller to do this, it is a very simple task. I prefer the PIC series from Microchip but you can use any you like.

Brian.
 

The MAX232 isn't a microcontroller and it isn't programmable. It is an RS232/TTL level converter and interface.

You can use many types of microcontroller to do this, it is a very simple task. I prefer the PIC series from Microchip but you can use any you like.

Brian.

oh, ok pradon my inexperience in this.

so i can download the development tools from PIC and buy their microcontrollers and i connect it to my pc and start doing my code?

what if i decide to use a 8051 ic chip, what program can i download to write my code and how can i compile my code into my chip? please advice

when i am done i just hook it up to my circuit??
 
Last edited:

But actually you can generate PWM using Max 232 from PC.
like generating
Code:
0b00000000
0b10000000
0b11000000
0b11100000
0b11110000
0b11111000
0b11111100
0b11111110
0b11111111
by sending these datas through UART the duty cycle can be varied and if you want a higher frequency you can use higher data rate.

lot of pwm dutycycles are possible.

But without some UART source like PC or controller, it is not possible to use a MAX232.

In PC you will need a compiler like keil for 8051
a programming software like flash magic
an programming kit and then a controller like 89v51rd2
 

Ok, i understand.

So does this connection sound ok, or am i missing on some components

8051 -> MAX232 -> RS232 ->Laptop(Using RS232 to usb cable)

and using KEIL to flash my 8051
 

1, are you using PC always with the controller?

2, why do you want go from 555 to controller?
 

Easiest way is to use a 32KHz watch crystal and counter chip to generate an output

The CD4060 allows an RC oscillator or low frequency crystal or ceramic resonator with a 14 stage counter that divides by 2^14 and 8 previous stages for 100Hz, 200, 400, 800,..... Up to the clock rate.

https://www.ti.com/lit/ds/symlink/cd4060b.pdf

Many other counters are common too.

No need for a uC to make a clock.

then you can buffer it many ways, 50 Ohm or lower or std. Logic buffer.
 

Just a warning if you use the UART to generate PWM: The number of different PWM ratios is limited and you will always have at least one low period and one high period due to the UART adding start and stop bits. It you are not careful to reload the UART as soon as its transmit buffer empties you will also get breaks in the PWM waveform.

Personally, I would try a simple PIC like a 12F683 or 12F1822 which has a built in UART and 10-bit PWM generator. It will allow any possible PWM ratio to be programmed over a serial link from a PC, need minial external components and costs ~$2. The tools to write programs in assembly language or 'C' are free from Microchip and the chip programmers cost very little too.

Brian.
 

1, are you using PC always with the controller?

2, why do you want go from 555 to controller?



eventually i wanna control the everything from my PC and not tuning the potential meter for the freq i want that is why i am thinking of using a controller type..

what i am looking is to build a uC so that i do not need to use a bulky signal generator. I also dun wish to spend so much buying a completed board with everything in it because then i can expand this into a stop watch/countdown.


as for betwixt,

so if i were to use PIC12F683 chip i will also have just to buy components such as max232/rs232 so i can connect it to my laptop right?
 

I wonder if you are asking for the wrong thing. Do you want PWM or variable frequency?

If you want to send commands from a PC to any microcontroller but do not need to read anything back, it is easiest to use a simple transistor level converter, then you don't even need the MAX232 at all. If you need two-way data the MAX232 is the easiest solution.

Brian.
 

but betwixt it can be made standard na, will be useful for future, like ACK, it is not going to cost much.

- - - Updated - - -

Can be But betwixt it can be made standard na, will be useful for future, like ACK,

It is not going to cost much.
 

I wonder if you are asking for the wrong thing. Do you want PWM or variable frequency?

If you want to send commands from a PC to any microcontroller but do not need to read anything back, it is easiest to use a simple transistor level converter, then you don't even need the MAX232 at all. If you need two-way data the MAX232 is the easiest solution.

Brian.

now i am using 555timer to make my pwm with different values of r2 to get a 50% duty cycle for each of the different freq that i want to use, therefore i would need to switch the wires to the correct resistor for my desired freq,

moving forward i only wan to change the code in my program to achieve this, that y i m looking into the chips that you guys are recommending like PIC
 

Then you don need MAX232/RS232 dude. might be needed only for some controllers when programming.

ok, i getting abit of the picture, if i am not wrong i can also connect a db9 connector to my PIC12 and using the correct cable to connect

please correct me if i am wrong,
 

Making it easy for you.

when you are using controllers you can produce variable frequency waveform, that is you already know.

but you can change the frequency without changing the program.
1, by giving signals from PC. (you will need MAX232)
2, by using pot (you need not to adjust dutycycle)
3, by using keypad and so on

If you are going to change the program for changing the frequency then you don need MAX232. (bcs PIC)

for programming you have to buy a standard pic programmer.
 
If I now understand your requirement, it isn't for PWM at all, you want a variable frequency square wave generator.

To clarify the MAX232 issue, that IC is an interface to convert the serial signal from/to a PC to the levels used by most microcontrollers. For historical reasons dating back to the time of mechanical teletype machines, the standard for serial signalling is to use the voltages -12V to represent a binary '1' and +12V to represent a binary '0'. Almost all microcontrollers use either 0V and +5V or use 0V and +3.3V and their logic is that 0V = binary '0' and the higher voltage = binary '1'. The MAX232 is there to translate between the two signal standards, it plays no active part in producing a signal of it's own.

Brian.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top