RS232C

koperton

Primus registratum
Re: RS232C

Tani u kujtova. Me falni! Me falni! Me falni!

Iki ne Shqiperi mbas 3 diteve per vitin e Ri dhe atje po vete per pushime. Atje nuk mund te bej asgje.
Nese doni code qe e kam gati per RS232 interface nga PC, vlerat e C,R per MAX232 per signal conditioning dhe full code per motorin te dy juve nuk heq dore kurre qe te kerkoni full apology.

Ceca Raznatovic. Femra me e bukur e Ballkanit.

ceca_raznatovic_012.jpg


Kenga qe me Pelqen "Vazduh Koji Disem"

Vazduh koji disem ne treba mi, ne
Kol'ko usne tvoje sto me ne ljube
Ne treba mi niko, pustite me svi

Idite, idite od mene
Pevajte, pijte, ljubite se
Idite, idite u zivot
Njegovo nista meni je sve

Voda koju pijem ne treba mi, ne
Kol'ko ruke tvoje sto me ne grle
Ne treba mi niko, pustite me svi

Idite idite od mene
Pevajte, pijte, ljubite se
Idite, idite u zivot
Njegovo nista meni je sve


---------------------
College Education cost Money. Then try Ignorance instead for Free. - Anonymous
 

gurax

Pan ignoramus
Re: RS232C

Well.. by popular demand, a snipet of useful information:

Unlike DOS, Windows 9x,NT,2000,XP work with hardware in a different way. While a DOS driver could be created with asm and have direct acsess to ports, it is a bit more complicated in Windows.It is connected with the fact that Windows, unlike DOS, is a multitasking system which makes it impossible to allow every application to directly change the hardware settings, as one application may fail to 'know' about the changes made to the hardware settings by some other application. Actually one can use asm in and out 378h functions under Windows 9x, but it is undesirable due to said above. To create programmes working with hardware under Windows one should use API (application programming interface). This interface allows to use Windows system services from application programmes. API realization is at that entrusted to the drivers. Windows Driver Developer Kit (DDK)is used to create drivers (there is a separate DDK for every Windows OS). Besides API one can use IOCTL codes (this method was widely used in DOS),but we shall deal with API functions only.

API standartizes work with hardware. To get access to hardware the following steps are used:
Get Handler of the device by calling CreateFile with the device name. For more information refer to. Windows SDK Help.
To control the device, call an API fuction for this device or send IOCTL(input - output control), the latter via DeviceIOCtl (for more information refer to Windows SDK Help).

In Windows all input/output ports are presented as files, so work with ports is mainly carried out via i/o functions of the file (CreateFile, CloseHandle, ReadFile, ReadFileEx, WriteFile and WriteFileEx). These functions organize the main interface for opening and closing the connection resource descriptor and carrying out read/write operations. API also includes a set of connection functions which provide access to connection resourses.
.

The usage of the I/O file and connection functions allows the application to perform the following tasks:
- Getting the serial port descriptor.
- Serial port configuration set and request.
- Reading from or writing into the serial port.
- Control of the given events set, which could occur for this serial port.

Sending the executive instructions to the driver of the device connected with the specified serial port; driver call-in is required for extended functions execution.
Eshte marre qe
ketu nga faqja e LookRS232 Debugger .

Knowing more than 5 line SQL queries doesn't save you from being a sorry fellow, Kopperton. If you go and read all the posts from the start while you're not munching on your little ego, you might notice there was nothing offensive rather than a cheerup call.
I've seen before such signs of not giving something up just for the sake of willingly combatting low self esteem and need to prove to you that you're not. What that means for the rest who happen arround, you don't care for you're proud now of what you've done!
I'd truly offer you a beer... few have done it before with you.

Peace!

-----------------
"Did I ever tell you..."
 

koperton

Primus registratum
Re: RS232C

Fillimisht postuar nga Gurax:
[qb]

What that means for the rest who happen arround, you don't care for you're proud now of what you've done!

I'd truly offer you a beer... few have done it before with you.

Peace!
[/qb]
Yes! Gurax I guess you are absolutely right. It was childish of me to make blackmailing like apologize to me or else.
You and us are grown up and to this part I have submitted enough information. I hope everybody does as much as I did. Technically.

You have C code how to reach RS232. 300 baud is fast for what he wants.
You have a program of a motor control above.
I even did submit a picture of how circuit is being operated.

All you need are R,C values to be accompany the MAX232. You read the MAX232 datasheet for it. I said figure5 is the one.

Yes true I am not proud for what I have done Gurax. Since when in here I posted something good?

I will not post anything more in this theme.
Also you need to take similarity in program posted above and code it in C for precise microcontroller.
It would be cheating if I give X-DJ.E a full solved assignment.

I apologise to you all guys for my previous comments. My deepest sencere apologies. Happy Holidays. Good Luck!

Gurax thanks for the beer. It counts. I did not have any personal ego. I love Ceca. That is my opinion she is most beautiful female in Balkan and if somebody does not respect it then so be it.
 

X-GoodBoy

Primus registratum
Re: RS232C

Yo, guys, thanx a lot, once again, for the help. Both of you provided something is one way or another, at least you gave a try. I appreciate that. Was nice. Now I think I solved the problem of RS232C. The baudrate is a fixed one, I mean it has just a range of values and cannot have values other than that range, so I made another modification. I used Delphi to send only (1) at TxD(x), and using a timer, i can control the delay so I can have different frequency output.

TxD(0) +12V
TxD(1) -12V

The MAX232 gives at pin 7 the output for:
0 -> +5V
1 -> -2V

I will use the frequency to voltage converter so it will produce the +15 0 and -15 Volt output. This will control the preaplifier which will control the power amplifier and the end the motor.
That is all i guess.
Anyway, have a drink on me for the time spent replying to my message.

Peace yo and enjoy the last days of this great year.
 

koperton

Primus registratum
Re: RS232C

Good. Yes 0 gets inverted so that is why you get 5V. They are inverted ports.

Good! But value of 2 volts is weird. Actually it is not. It means the inverter impedance at pin7 has changed or possibly you are operating it in slightly in different datarate. Figure1 in datasheet. What are your Cap values? See and check them.

Use instead of 7 pin use 14 pin as my picture above. They are the same thing. Use figure5 in datasheet for anything else.

Otherwise change the chip. If you get the same you possibly have a current leak somewhere in chip. If school gave you this chip I bet that is the reason. They have been used before.

I am glad you made it.
 

X-GoodBoy

Primus registratum
Re: RS232C

The C = 1uF electrolythic. I have another IC so I will check it out. Normally should be 0 volt out of it and not -2. I got the schematic from the datasheet so i used those values. Pin 14 I tried but with pin 11 as an input. same story.
Check this schematic below:
adcckt.jpg


I used similar to this one.

Electronics is a cool subject. You can do a lot of interesting things.
By the way, thanx dude for you help.

Peace.
 

109UV

Primus registratum
Re: RS232C

Fillimisht postuar nga Gurax:
[qb] I've seen before such signs of not giving something up just for the sake of willingly combatting low self esteem and need to prove to you that you're not. [/qb]
U bone si Dr. Phil, gjithe filozofi. Por me duket se po flet per veten pasi ngul kembe per dicka qe nuk di. Ne menyre konceptuale, cdo lloj programimi kthehet ne assembly, right? dhe instruksionet ne assembly kur merren nga procesori interpretohen, read regjistrin 1, kopjo data ne regjistrin 2, shkruaj ne bus, lexo interrupt etj etj. Prandaj, nuk ka rendesi nese ti perdor device driver, Dr.Phil driver, apo plain old C. rendesi ka qe procesori te marre komanden e duhur per te shkruar apo lexuar ne/nga COM port.

Ai artikulli qe citove vete ta thote shume qarte, nepermjet metodes se leximit midis rreshtave, qe eshte e preferuar qe punet te behen nepermjet device drivers sepse mund te kete concurrent access issues etj etj, (gjera qe nuk i hyjne ne pune mikut tone qe ka nje detyre per te bere) por eshte e mundur dhe direct access ne COM port.

Prandaj, mendoj qe eshte me mire qe te leme keta qe kane interes ne kete pune te vazhdojne te kooperojne dhe ndihmojne njeri-tjetrin.

And now, I remove myself from the "tema", wishing good luck to you all, no exceptions. Time to get back to work that matters financially.
 

koperton

Primus registratum
Re: RS232C

Go ahead with -2. negative logic, logic '1' is -3V to -12V and logic '0' is +3V to +12V.

You are inside safety limits. RS232C is also flexible. I mostly use Dallas DS275 instead of MAX232 because it does not requires external caps. Your MAX232 needs at least 3caps.

Your board may come with MAX232, who knows. Atmel 2051 processors family are all equipped with flash memory.

What I meant for you to check caps because these electrolitic caps do get discharged with time and use. See the caps 33pF in X-tal. They are ceramic. They live forever. Actually not that much forever. It maybe not exact 1uF or close to it. Who knows maybe half of it and that may influence that 2 volts you get. Measure it and waste the time. Oh caps are soldered into the board right?

Go ahead with the rest man. You yet yet has not told here what is your chip. 2051 there are many.

What HEX writer/uploader programmer school told you to use to write or upload HEX to the chip?
Sometimes I have found this to be important in understanding of uC.
Is it custom built by school or is it bought somewhere?

In using CC51
This is how I would make an exclusive OR latch at P1

test.c

#include d:cc518051io.h
#include d:cc518051reg.h

main()
{
while(1) /* loop continiously */
{
P1 ^= 0x80; /* here*/
delay(500); // half second
* *

I would compile it later
"cc51 test.c -il h=d:cc51 m=t"

Hex is:
:0300000002000EED
:03000300020028D0
:20000B0002001F758108D2AFD2A912002B80FE12001B80FB758CDC758A00050832050832FD
:20002B00E5906480F59074F475F001C0E0C0F01200451581158102002B2278FB120062867A
:20004B0003088604BB0004BC00012279E5A3D9FD1BBBFFF01C80F4C82581C822C92581C9A6
:20006B007A0022D083D082CF2581F581CFC082C08322CF2581F581CF221200976009E4F50C
:20008B00F02212009760F7E4F5F00422C5F0C39C7003E5F09B22FBE493CB22FCE493FB74FA
:0D00AB000193CC22FAE493F9740193CA2268
:00000001FF

take it to 2051 using the HEX upload to the chip.


I gotta to go. Bye. As I told you in the first post of mine here check keil.com
 

koperton

Primus registratum
Re: RS232C

Fillimisht postuar nga 109UV:
cdo lloj programimi kthehet ne assembly, right? dhe instruksionet ne assembly kur merren nga procesori interpretohen, read regjistrin 1, kopjo data ne regjistrin
Most Absolutely right!

Ky djali qe do te beje motorin te shikoje si eshte bere ne assembly ne code qe une postova. ke shenimet per majtaj, djathtas, mbrapa, perpara dhe si te ndezesh nje LED. E gjitha eshte ne Loop subroutine.

Nuk ka asgje per te u cuditur. Sot kemi codewords like JTAG,AVR etj etj. Code me duket se eshte per NASM assambler I guess.

Merr nje simulator dhe shikoje po deshe. Une te vura dhe shenimet per ty. E do kodin ne C ta postoj ketu une.

type "debug" ne DOS

type this code
a100
mov ah, 2
int 21
mov dl, 41
int 21
mov dl, 6C
int 21
mov dl, 62
int 21
mov dl, 66
int 21
mov dl, 6F
int 21
mov dl, 72
int 21
mov dl, 75
int 21
mov dl, 6D
int 21
mov dl, 69
int 21
int 20
------ 2 ENTER
press g

Output is: Albforumi

D:debug

-a100
0B6A:0100 mov ah, 2
0B6A:0102 int 21
0B6A:0104 mov dl, 41
0B6A:0106 int 21
0B6A:0108 mov dl, 6C
0B6A:010A int 21
0B6A:010C mov dl, 62
0B6A:010E int 21
0B6A:0110 mov dl, 66
0B6A:0112 int 21
0B6A:0114 mov dl, 6F
0B6A:0116 int 21
0B6A:0118 mov dl, 72
0B6A:011A int 21
0B6A:011C mov dl, 75
0B6A:011E int 21
0B6A:0120 mov dl, 6D
0B6A:0122 int 21
0B6A:0124 mov dl, 69
0B6A:0126 int 21
0B6A:0128 int 20
0B6A:012A <-ketu 2 ENTER keys
-g
Albforumi
Program terminated normally
-q

Tani ka tools me te pershtatshme por ta shikojne sa kemi vuajtur neve per te gjetur serial number te nje programi shareware me perpara. Dump memory dump code. etj etj.

Ne meritojme jo Ceca Raznatovic te kemi dashnore por dhe Barbara Bush. heh!

Gezuar Vitin e Ri 2004 dhe Krishtelindjet Albforumi!

ceca_raznatovic_012.jpg


Honestly all joking aside she is great!
 

X-GoodBoy

Primus registratum
Re: RS232C

Hi dude and happy new year!
I changed the system. I'm gonna use the Max232 + two uA741 to make an adder so at the end I can have +5 0 -5.
Microcontroller was too damn long way and the time is too short to implement it.
Anyway, thanx for the info you provided.

Cheers...
 
Top