امتیاز موضوع:
  • 0 رأی - میانگین امتیازات: 0
  • 1
  • 2
  • 3
  • 4
  • 5
كار با Mouse
نویسنده پیام
mohpooria آفلاین
كاربر تک ستاره
*

ارسال‌ها: 25
موضوع‌ها: 3
تاریخ عضویت: اسفند ۱۳۸۵

تشکرها : 0
( 5 تشکر در 4 ارسال )
ارسال: #1
كار با Mouse
سلام آقا هادي
شما ميدانيد چگونه مي توان موس را به AVR متصل كرد و از روي آن خواند
من اول به همان روش خواندن از كيبورد امتحان كردم ولي كار نكرد
بعد هم به طريق سريال مي خواستم از روي آن بخوانم ولي كار نكرد يعني همش عدد هايي بين 50 تا 60 نشان مي داد.

خيلي ممنونم Biggrin Biggrin
۲۵-اسفند-۱۳۸۵, ۰۰:۲۵:۲۱
ارسال‌ها
پاسخ
ha_60 آفلاین
بنيانگذار سايت
******

ارسال‌ها: 4,637
موضوع‌ها: 216
تاریخ عضویت: آبان ۱۳۸۳

تشکرها : 560
( 6556 تشکر در 2385 ارسال )
ارسال: #2
 
سریال کار می کنه دقیقا هم RS232 (البته نوع قدیمی این جدید ها هم تبدیل می شه اما دقیقا نمی دونم چه جوری)
دو مدل داشت سه بایتی و 2 بایتی انگار و با هم هم فرق می کنه یه گشتی بزنی پیدا می کنی چیز های تو اینتر نت فقط بادریت رو در بیاری فکر کنم کارت راه بیفته (فکر کنم 9600 بود با vb6 پیش نهاد می کنم امتحان کنی)

هادی امین زاده
دیدن چیزی که همه می بینند هنر نیست
بانک اطلاعات صنایع ایران.
۲۶-اسفند-۱۳۸۵, ۰۰:۴۶:۰۵
وب سایت ارسال‌ها
پاسخ
تشکر شده توسط : t3r!p3000
mohpooria آفلاین
كاربر تک ستاره
*

ارسال‌ها: 25
موضوع‌ها: 3
تاریخ عضویت: اسفند ۱۳۸۵

تشکرها : 0
( 5 تشکر در 4 ارسال )
ارسال: #3
 
حالا من چكار كنم
باود شما درست نود
در اينترنت هم چيزي پيدا نكردم
۲۷-اسفند-۱۳۸۵, ۱۲:۲۸:۰۵
ارسال‌ها
پاسخ
ha_60 آفلاین
بنيانگذار سايت
******

ارسال‌ها: 4,637
موضوع‌ها: 216
تاریخ عضویت: آبان ۱۳۸۳

تشکرها : 560
( 6556 تشکر در 2385 ارسال )
ارسال: #4
 
از کجا می گی درست نبود؟ اعدادی که می گرفتی چی بود تعدادش زیاد تر بود یا کمتر؟ یا اصلا چیزی در یافت نمی کردی؟
این یه پایه rts داره که باید یک کنی چون کل تغذیه موس از این پایه تامین می شه یه برنامه تو سایت هست با همون تست کن من با اون امتحان می کردم کار می کرد باد ریت هم چند تا بیشتر نیست که همه رو امتحان کن ولی 9600 بود

هادی امین زاده
دیدن چیزی که همه می بینند هنر نیست
بانک اطلاعات صنایع ایران.
۲۷-اسفند-۱۳۸۵, ۱۳:۴۰:۳۹
وب سایت ارسال‌ها
پاسخ
تشکر شده توسط : t3r!p3000
Iran-PC آفلاین
كاربر دو ستاره
**

ارسال‌ها: 101
موضوع‌ها: 6
تاریخ عضویت: شهریور ۱۳۸۵

تشکرها : 0
( 5 تشکر در 5 ارسال )
ارسال: #5
 
سلام.
باد ریتش احتمالا 19200 هستش.
من قبلا با آقا پوریا گفتم چیکار کنه. گوش نکرد.
بسکام خودش دستوراتی داره که موس رو شبیه سازی میکنه.
یعنی میشه مثل موس
حالا ایشون اگه از 2 تا میکرو استفاده کنه (یکی به عنوان موس که خودش به اون دستور حرکت وکلیک رو بده)
یک هم باشه که بفهمه برای هر نوع حرکت و کلیک چه کدی میفرسته.
اینجوری مطمئن تره.
۲۷-اسفند-۱۳۸۵, ۱۴:۵۳:۴۳
ارسال‌ها
پاسخ
تشکر شده توسط : t3r!p3000
mohpooria آفلاین
كاربر تک ستاره
*

ارسال‌ها: 25
موضوع‌ها: 3
تاریخ عضویت: اسفند ۱۳۸۵

تشکرها : 0
( 5 تشکر در 4 ارسال )
ارسال: #6
 
سلام آقا فرقي نداره از موس هاي سريال استفاده كنيم يا از موس هاي PS/2 ؟
من از PS/2 استفادهكردم و باز هم همتحان مي كنم شايد بد امتحان كردم عدد دريافت نمي كردم
راستي كدام برنامه ميشه ايجا لينكش را بگذاريد

ايران پي سي جان خوب من يك ميكرو رو موس كردم بعد آن ميكرو رو چگونه پيكر بندي كنم يعني سريالش را چگونه CONfig كنم
اگر مي شود بيشتر توضيح دهيد

راستي من يك ديتا شيت براي تفكيك بيت ها پيدا كردم دارم ترجمه اش مي كنم موس هر دفعه 11 بيت اطلا عات ميفرستد كه دسته بندي دارد
دارم روش كار مي كنم.

واقعا ممنون :oops: :oops:
۲۸-اسفند-۱۳۸۵, ۱۰:۵۴:۲۱
ارسال‌ها
پاسخ
ha_60 آفلاین
بنيانگذار سايت
******

ارسال‌ها: 4,637
موضوع‌ها: 216
تاریخ عضویت: آبان ۱۳۸۳

تشکرها : 560
( 6556 تشکر در 2385 ارسال )
ارسال: #7
 
من با سریال کار کردم خوب هم کار می کرد اما ps2 ها هم به سریال تبدیل می شه اما نمی دونم چه جوریه

http://www.iranled.com/article4.html

هادی امین زاده
دیدن چیزی که همه می بینند هنر نیست
بانک اطلاعات صنایع ایران.
۲۸-اسفند-۱۳۸۵, ۲۲:۲۸:۲۵
وب سایت ارسال‌ها
پاسخ
mohpooria آفلاین
كاربر تک ستاره
*

ارسال‌ها: 25
موضوع‌ها: 3
تاریخ عضویت: اسفند ۱۳۸۵

تشکرها : 0
( 5 تشکر در 4 ارسال )
ارسال: #8
 
يعني چي تبديل مي شود؟
منمي خواهم از موس هاي اپتيكال استفاده كنم ولي سريال اپتيكال نيست
PS/2 مي خواهم
۲۹-اسفند-۱۳۸۵, ۱۰:۳۶:۱۴
ارسال‌ها
پاسخ
ha_60 آفلاین
بنيانگذار سايت
******

ارسال‌ها: 4,637
موضوع‌ها: 216
تاریخ عضویت: آبان ۱۳۸۳

تشکرها : 560
( 6556 تشکر در 2385 ارسال )
ارسال: #9
 
گرفتم این دوتا به این راحی ها به هم تبدیل نیم شن بعضی از موس ها خودشون تشخیص می دن rs232 یا ps/2 اما خود ps/2 کاملا ttl هست و سنکرون اینا رو ببین
لینک http://www.technick.net/public/code/cp_d..._mouse_ps2
کد:
PS2 ports use synchronous serial signals to communicate between the keyboard or mouse to the computer. The signals are all TTL logic level voltages (0 volts for logical 0 and +5 volts for logical 1). Bi-directional communications are supported on all PS2 ports (mostly for keyboards but may be implemented in mouse only ports), all bi-directional transmissions are controlled by the clock and data lines. This feature is controlled by an open collector architecture which lets both lines to be forced to logical 0 by the device (mouse or keyboard) or the host computer. This means that at any point in time the host can force the clock line to 0 and inhibit the mouse to transmit. If the host inhibits while the mouse is transmitting the transmitted data must be retransmitted. Although this may seem odd, both ports are usually controlled by an INTEL 8042 keyboard controller (yes the keyboard controller also controls the PS2 mouse port on it's second channel).
Data transmission from the mouse to the computer is done as in figure 1, each clock period is usually between 70 to 150 microseconds (10 to 25 microseconds for transitions and 30 to 50 microseconds for high or low state), some may feel that these are large margins both this works good since this is a synchronous port (this also helps cut on the cost of high precision clocks). The data line transition is made on the falling edge of the clock signal and is usually sampled when the clock is low. Each data packet is composed of 11 bits, 1 start bit (which is low), 8 data bits, 1 odd parity bit and 1 stop bit (high).
Send data packet

Figure 1: SEND DATA PACKET
When the PS2 mouse sends it's information it must send 3 consecutive data packets in a row. Each packet sent has different information for button pressed, movement and direction of movement. The table below shows what information is sent in each packet. Please remember that this information is of general nature and can change from one manufacturer to another. This is for a 2 button mouse, I have no idea what bit is used for other types of mouses like 3 buttons and others that have special functions like an up-down wheel for scrolling within windows.

    D7    D6    D5    D4    D3    D2    D1    D0
1st    YV    XV    YS    XS    1    0    R    L
2nd    X7    X6    X5    X4    X3    X2    X1    X0
3rd    Y7    Y6    Y5    Y4    Y3    Y2    Y1    Y0

L    Left Button State (1 = pressed down)
R    Right Button State (1 = pressed down)
X0-X7    Movement in the X direction
Y0-Y7    Movement in the Y direction
XS    Direction of the movement in the X axis (1 = UP)
YS    Direction of the movement in the Y axis (1 = LEFT)
XV,YV    Overflow of the movement data bits (1 = overflow has occured)

The X and Y direction bits send the number of bits you moved since the last time this information was sent, the actual direction of the movement is sent in the XS and XY bits. If the movement of the mouse was higher than 255 data displacements since the information was last sent the overflow bit will go to one and will reset back to 0 as soon as the current data is sent. The way the driver handles overflow can change from one mouse driver to another, some may move the pointer 256 data bits and some may even decide to leave the pointer where it is! Some of you might wonder what exactly are the data bits sent for the movement bits, you will be able to shortly find this out in the i/o devices section on mouses which will be online shortly!
PS2 MOUSE ADAPTERS
Many of you have requested information on adapting serial mouses to PS2 ports and vice-versa. This is a very touchy subject and I wouldn't recommend to anyone to go ahead and make these adapters. Most mouses are either built for PS2 or serial ports and some are built for both, in the later case the appropriate adapters are supplied with the mouse when you buy it or can be purchased as an option.
Because of the nature of the ports the two kinds of mouses are not directly compatible. They don't send out the information in the same matter (different protocols) and don't use the same signal levels, PS2 mouses uses TTL logic signals (0-5 volts) and serial mouses use RS232 signals (typically +10 volts - -10 volts). When a mouse is built for operation on both ports, are setup with a 9 pin D-Shell used in serial mouses, these connectors have 9 pins and the serial mouse only uses between 5 and 8 pins. This leaves us with at least 1 spare line, this is the line that the PS2 data portion of the mouse will use for sending it's information. So as you can see, the adapters are designed to work on a particular make and model and are not usually compatible with other mouses.

6 PIN MINI-DIN FEMALE
(At the computer)

6 PIN MINI-DIN FEMALE (PS/2 STYLE) at the computer.
Pin     Name     Dir     Description
1     DATA     IN/OUT     Key Data
2     n/c     -     Not connected
3     GND     ------     Ground
4     VCC     OUT     Power , +5 VDC
5     CLK     OUT     Clock
6     n/c     -     Not connected

Note: Direction is Computer relative Mouse/Keyboard.

UNKNOW 6 PIN SDL FEMALE (PS/2 STYLE) at the computer.
Pin     Name     Dir     Description
A     n/c     -     Not connected
B     DATA     IN/OUT     Key Data
C     GND     ------     Ground
D     CLK     OUT     Clock
E     +5V     OUT     Power , +5 VDC
F     n/c     -     Not connected

Data
Mouse data packets or keyboard scan codes are sent from the mouse or keyboard to the computer on this single wire serially.
Clock
This signal is sent from the mouse or keyboard to synchronise the data signal.
+5 Vdc
This is a simple 5 volts signal for giving power to the mouse or keyboard.
Ground
This is a common ground signal used as a return path for data and is a reference to logical 0.

هادی امین زاده
دیدن چیزی که همه می بینند هنر نیست
بانک اطلاعات صنایع ایران.
۰۱-فروردین-۱۳۸۶, ۰۹:۲۱:۲۸
وب سایت ارسال‌ها
پاسخ
تشکر شده توسط : t3r!p3000
mochen آفلاین
تازه وارد

ارسال‌ها: 12
موضوع‌ها: 0
تاریخ عضویت: دى ۱۳۸۵

تشکرها : 0
( 2 تشکر در 2 ارسال )
ارسال: #10
 
عزیزم من کار کردم و جواب هم گرفتم تا چند روز یگه ای PDFفارسی که خود دارم می نویسم برات می زارم فقط یکم سرم شلوغه
راستی با Bsacom هست
:wink: ---------------------------------------------------rTQc-------------------------------------------------
۰۴-فروردین-۱۳۸۶, ۰۴:۰۷:۲۶
ارسال‌ها
پاسخ
تشکر شده توسط : t3r!p3000
mohpooria آفلاین
كاربر تک ستاره
*

ارسال‌ها: 25
موضوع‌ها: 3
تاریخ عضویت: اسفند ۱۳۸۵

تشکرها : 0
( 5 تشکر در 4 ارسال )
ارسال: #11
 
آقا ما بینهایت منتظریم
منت گذاشتید اگر برنامه خود را اینجا بگذارید
ان شا الله جبران کنم
ممنون
۰۵-فروردین-۱۳۸۶, ۰۸:۰۷:۲۳
ارسال‌ها
پاسخ


موضوعات مرتبط با این موضوع...
موضوع نویسنده پاسخ بازدید آخرین ارسال
  logitech mouse protocol mortz65 0 1,284 ۱۵-بهمن-۱۳۹۱, ۱۵:۲۵:۲۳
آخرین ارسال: mortz65

پرش به انجمن:


کاربرانِ درحال بازدید از این موضوع: 4 مهمان

صفحه‌ی تماس | IranVig | بازگشت به بالا | | بایگانی | پیوند سایتی RSS