打印

单片机怎么获取电脑的分辨率或者绝对坐标值?

[复制链接]
2475|11
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
graycker|  楼主 | 2012-5-12 11:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
ljwmf| | 2012-5-12 11:10 | 只看该作者
做一个上层软件在电脑运行,跟单片机之间串口通信,软件获取分辨率等信息发给单片机。

使用特权

评论回复
板凳
graycker|  楼主 | 2012-5-12 11:14 | 只看该作者
我想知道有什么办法直接获取,不通过上位机的那种
(那个办法想过,但看到别人做的可以不用上位机的)

使用特权

评论回复
地板
ljwmf| | 2012-5-12 12:36 | 只看该作者
研究下VGA线的作用。

使用特权

评论回复
5
graycker|  楼主 | 2012-5-12 13:47 | 只看该作者
我USB接口接到电脑,怎么连到VGA呢?

使用特权

评论回复
6
lyjian| | 2012-5-12 16:11 | 只看该作者
直接找系统要信息

使用特权

评论回复
7
Tinnal| | 2012-5-14 13:47 | 只看该作者
1# graycker
小伙,PC写一个软件,获得分辨率后通过串口发给单片机是最方便的,鉴于你这么问题,我猜你也肯定是新手,如果PC没有串口的话,就用USB转串口线转吧。CH372不是不行,怕你倒时候出问题。

如果你**不写PC的软件,那只能像ljwmf所说,去检测VGA信号了,通过VGA信号线中的场同步和行同步信号线的信号频率,可以估计出屏幕的分辨率。你只要用单片机的timer去测频就行。51可以够呛,M31应该还可以。给你一份别人用FPGA写得东西。你可以参考一下。
http://wenku.baidu.com/view/25caab0f76c66137ee06193c.html

至于你说的绝对坐标值,我就不清楚你想得到什么东西的绝对坐标值了。你可以说清楚点吗?

使用特权

评论回复
8
qnmdsb2008| | 2012-5-14 16:43 | 只看该作者
单片机加fpga方案

使用特权

评论回复
9
宇容创行| | 2012-5-14 17:29 | 只看该作者
还可以挂在vga 的i2c 总线上

使用特权

评论回复
10
Tinnal| | 2012-5-15 00:28 | 只看该作者
10# 宇容创行
VGA 的i2c线只用于读取显示器的参数。而不是当前的配置。

http://www.lammertbies.nl/comm/cable/VGA-monitor.html
The DB15 VGA connector contains however 15 pins in three rows of 5 pins each. These five pins not only carry the color and synchronisation signals, but also a digital I2C interface for two-way communication between the video controller and monitor. This I2C interface makes the VGA interface very versatile. The I2C interface wasn't available on the original VGA connector definition, but has been added by the VESA DDC2 definition. Via this I2C interface the video controller and monitor can exchange information about maximum capabilities like resolution and frequencies supported which prevents incompatible display modes to be selected.




又见http://en.wikipedia.org/wiki/Display_Data_Channel
The DDC suite of standards aims to provide a "plug and play" experience for computer displays.
DDC1 and DDC2B/Ab/B+/Bi protocols are a physical link between a monitor and a video card, which was originally carried on either two or three pins in a 15-pin analog VGA connector.
Extended display identification data (EDID) is a companion standard; it defines a compact binary file format describing the monitor's capabilities and supported graphics modes, stored in a read-only memory (EEPROM) chip programmed by the manufacturer of the monitor. The format uses a description block containing 128 bytes of data, with optional extension blocks to provide additional information. The most current version is Enhanced EDID (E-EDID) Release A, v2.0.
The first version of the DDC standard was adopted in August 1994. It included the EDID 1.0 format and specified DDC1, DDC2B and DDC2Ab physical links.
DDC version 2, introduced in April 1996, split EDID into a separate standard and introduced the DDC2B+ protocol.
DDC version 3, December 1997, introduced the DDC2Bi protocol and support for VESA Plug and Display and Flat Panel Display Interface on separate device addresses, requiring them to comply with EDID 2.0.
The DDC standard has been superseded by E-DDC in 1999.

使用特权

评论回复
11
dobypig| | 2012-5-15 10:40 | 只看该作者
计算vga信号的行和帧数可以算出来的,fpga就可以了

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

150

帖子

2

粉丝