使用STM32官方固件库在MDK中建立工程

Posted in stm32 on 二月 10th, 2012 by Logo – Be the first to comment

截止我发这个帖子为止
MDK为最新版本4.23版本
固件库也为最新版本3.5版本

http://bbs.21ic.com/attachment.php?aid=95134&k=865eed8df6c0a1562d68f3bde21dd5c5&t=1328875531&sid=b769gjyVmHZtynog7HGvqqtE9Fup%2FupReIiEw75bZOcg7mk

protel USB插座(A&B形)

Posted in other on 一月 24th, 2012 by Logo – Be the first to comment

 注:以下均为插座或插头的前视图,即将插座或插头面向自己。

USB A型插座和插头

                     

       USB A型插座引脚分布    

  

     USB A型插头引脚排列分布

 

USB B型插座和插头

                  

              USB B型插座引脚分布          

      

  USB B型插头引脚分布

 

USB mini-B 插座和插头

         USB mini-B型插座引脚分布 

      

USB mini-B型插头引脚分布

 

 

USB A-B型引脚功能

引脚序号 功能名 典型电线颜色
1 VBUS
2 D-
3 D+ 绿
4 GND
Shell Shield  

 

USB mini-B型引脚功能

引脚序号 功能名 典型电线颜色
1 VBUS
2 D-
3 D+ 绿
4 ID 不用
5 GND
Shell Shield  

 

关于插座插头的机械尺寸请参考USB标准上的典型机械尺寸,更可靠的是以连接器生产厂的尺寸为准。

protel 文件下载

河南网通用户名转换工具(HaCncConvert)

Posted in other on 一月 11th, 2012 by Logo – Be the first to comment


HaCncConvert(河南网通用户名转换工具):
针对河南地区网通用户无法直接在路由器里使用宽带账号拨号,将账号进行转换,转换过后的账号才可以路由器里使用。
下载

自动循迹小车

Posted in 8051 on 一月 11th, 2012 by Logo – Be the first to comment

用了将近半个月做的,累啊……

jquery幻灯片插件——bxslider

Posted in javascript/jquery on 一月 11th, 2012 by Logo – Be the first to comment

STC-ISP下载原理图(验证通过)

Posted in 8051 on 一月 11th, 2012 by Logo – Be the first to comment

windows mobile 串口编程

Posted in windows mobile on 十二月 6th, 2011 by Logo – Be the first to comment


/*********************************************
 *软件名:ComTool_for_WM.exe
 *软件功能:串口调试功能
 *适用平台:windows mobile 5.0/6.5
 *作者:Logo  
 *Email:i#dopood.com(为防止垃圾邮件,请将#改为@)
 *时间:2011.12.06
 *备注:如有需要批评指正请联系作者.
 ********************************************/
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
using System.Threading;

namespace last
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            tabPage3.Enabled = false;
            tabPage2.Enabled = false;

            string[] ports = SerialPort.GetPortNames();
            for (int i = 0; i < ports.Length; i++)
            {

                this.comboBox1.Items.Add(ports[i]);
            }

        }

        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (serialPort1.IsOpen)
                {

                    button1.Text = “打开端口”;
                    tabPage3.Enabled = false;
                    tabPage2.Enabled = false;
                    serialPort1.Close();

                }
                else
                {
                    //更改参数
                    serialPort1.PortName = comboBox1.Text;
                    serialPort1.BaudRate = int.Parse(comboBox2.Text);
                    serialPort1.DataBits = int.Parse(comboBox3.Text);

                    //奇偶校验位设置
                    string[] Par_arr = new string[] { “无”, “偶”, “奇”, “标志”, “空格” }; //不定长

                    if (comboBox4.Text == Par_arr[0])
                    {
                        serialPort1.Parity = Parity.None;
                    }
                    else if (comboBox4.Text == Par_arr[1])
                    {
                        serialPort1.Parity = Parity.Even;
                    }
                    else if (comboBox4.Text == Par_arr[2])
                    {
                        serialPort1.Parity = Parity.Odd;
                    }
                    else if (comboBox4.Text == Par_arr[3])
                    {
                        serialPort1.Parity = Parity.Mark;
                    }
                    else if (comboBox4.Text == Par_arr[4])
                    {
                        serialPort1.Parity = Parity.Space;
                    }

                    //停止位设置
                    string[] Sto_arr = new string[] { “1″, “1.5″, “2″ }; //不定长

                    if (comboBox5.Text == Sto_arr[0])
                    {
                        serialPort1.StopBits = StopBits.One;
                    }
                    else if (comboBox5.Text == Sto_arr[1])
                    {
                        serialPort1.StopBits = StopBits.OnePointFive;
                    }
                    else if (comboBox5.Text == Sto_arr[2])
                    {
                        serialPort1.StopBits = StopBits.Two;
                    }

                    //打开串口(打开串口后不能修改端口名,波特率等参数,修改参数要在串口关闭后修改)
                    serialPort1.Open();
                    // buttonSend.Enabled = true;
                    tabPage3.Enabled = true;
                    tabPage2.Enabled = true;
                    button1.Text = “关闭端口”;
                }
            }
            catch
            {
                MessageBox.Show(“请选择合适的端口号!”);
            }
        }
        private void buttonClean_Click(object sender, EventArgs e)
        {
            textBoxRec.Text = “”;

        }
        private void buttonSend_Click(object sender, EventArgs e)
        {
            if (textBoxSend.Text != “”)
            {

                System.Text.UTF8Encoding utf8 = new System.Text.UTF8Encoding();
                Byte[] writeBytes = utf8.GetBytes(textBoxSend.Text);
                serialPort1.Write(writeBytes, 0, writeBytes.Length);

            }
            else
            {
                //MessageBox.Show(“输入为空”);
            }

        }
        private StringBuilder builder = new StringBuilder();
        private void DataRec(object sender, SerialDataReceivedEventArgs e)
        {
            //因为要访问ui资源,所以需要使用invoke方式同步ui。
            this.Invoke((EventHandler)(delegate
                      {
                          System.Text.UTF8Encoding utf8 = new System.Text.UTF8Encoding();
                          Byte[] readBytes = new Byte[serialPort1.BytesToRead];
                          serialPort1.Read(readBytes, 0, readBytes.Length);
                          String decodedString = utf8.GetString(readBytes, 0, readBytes.Length);
                          this.textBoxRec.Text += decodedString;

 

 

                          textBoxCallBack.Text = decodedString;
                      }));
        }

        private void menuItemAbout_Click(object sender, EventArgs e)
        {
            MessageBox.Show(“ComTool\n版本号:11.11.11.1\nEmail:535343589@qq.com”, “关于:ComTool”);
        }
        private void Form1_exit(object sender, EventArgs e)
        {
            DialogResult result;
            result = MessageBox.Show(“确定要退出程序吗?”, “提示:”, MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

            if (result == DialogResult.OK)
            {
                Application.Exit();
            }
        }

        private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            textBoxInstruction.Text = “前”;
            textBoxCode.Text = “1″;
            serialPort1.Write(“1″);
        }

        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            textBoxInstruction.Text = “停”;
            textBoxCode.Text = “5″;
            serialPort1.Write(“5″);
        }

        private void pictureBox2_MouseDown(object sender, MouseEventArgs e)
        {
            textBoxInstruction.Text = “后”;
            textBoxCode.Text = “2″;
            serialPort1.Write(“2″);
        }

        private void pictureBox2_MouseUp(object sender, MouseEventArgs e)
        {
            textBoxInstruction.Text = “停”;
            textBoxCode.Text = “5″;
            serialPort1.Write(“5″);
        }

        private void pictureBox3_MouseDown(object sender, MouseEventArgs e)
        {
            textBoxInstruction.Text = “左”;
            textBoxCode.Text = “3″;
            serialPort1.Write(“3″);
        }

        private void pictureBox3_MouseUp(object sender, MouseEventArgs e)
        {
            textBoxInstruction.Text = “停”;
            textBoxCode.Text = “5″;
            serialPort1.Write(“5″);
        }

        private void pictureBox4_MouseDown(object sender, MouseEventArgs e)
        {
            textBoxInstruction.Text = “右”;
            textBoxCode.Text = “4″;
            serialPort1.Write(“4″);
        }

        private void pictureBox4_MouseUp(object sender, MouseEventArgs e)
        {
            textBoxInstruction.Text = “停”;
            textBoxCode.Text = “5″;
            serialPort1.Write(“5″);
        }
    }
}

文件下载

单片机最小系统原理图

Posted in 8051 on 十二月 6th, 2011 by Logo – Be the first to comment

VS2008 Win7 Microsoft Incremental Linker

Posted in c/c++ on 十月 29th, 2011 by Logo – Be the first to comment

/INCREMENTAL 选项控制链接器如何处理增量链接。

默认情况下,链接器以增量模式运行。若要重写默认增量链接,请指定 /INCREMENTAL:NO。

增量链接的程序在功能上等效于非增量链接的程序。不过,因为它是为后面的增量链接而准备的,所以增量链接的可执行 (.exe) 文件或动态链接库 (DLL):

大于非增量链接的程序,因为有代码和数据的填充。(填充允许链接器增加函数和数据的大小而不用重新创建 .exe 文件。)
可以包含跳转 thunk 以处理函数重定位到新地址。
注意
为了确保最终发布版本不包含填充或 thunk,请非增量链接您的程序。

若要增量链接而不管默认值,请指定 /INCREMENTAL。选定该选项后,如果链接器无法增量链接,它就会发出警告,然后非增量链接程序。某些选项和情况重写 /INCREMENTAL。

大多数程序都可以增量链接。然而,某些更改太大,某些选项与增量链接不兼容。如果指定了任何下列选项,则 LINK 执行完全链接:

增量链接未被选定 (/INCREMENTAL:NO)
选定 /OPT:REF
选定 /OPT:ICF
选定 /ORDER
指定 /DEBUG 时暗含 /INCREMENTAL。

另外,如果发生以下任何情况,则 LINK 执行完全链接:

缺少增量状态 (.ilk) 文件。(LINK 将创建新的 .ilk 文件以为后面的增量链接作准备。)
对 .ilk 文件没有写入权限。(LINK 忽略 .ilk 文件并进行非增量链接。)
缺少 .exe 或 .dll 输出文件。
更改 .ilk、.exe 或 .dll 的时间戳。
更改 LINK 选项。大多数 LINK 选项在各生成间更改时导致完全链接。
添加或省略对象 (.obj) 文件。
更改用 /Yu /Z7 选项编译的对象。
在 Visual Studio 开发环境中设置此链接器选项
打开此项目的“属性页”对话框。有关详细信息,请参见设置 Visual C++ 项目属性。
单击“链接器”文件夹。
单击“常规”属性页。
修改“启用增量链接”属性为默认值。

Google URL Shortener

Posted in other on 十月 26th, 2011 by Logo – 1 Comment

http://goo.gl/
eg:http://goo.gl/fqOYx