亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? picservo.lst

?? Code ASM for PIC16F628. Use for CNC/Servo Motor. With simulatio in Proteus (7.0)
?? LST
?? 第 1 頁 / 共 5 頁
字號:
MPASM  4.02 Released                             PICSERVO.ASM   12-31-2006  11:50:00         PAGE  1


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00001         LIST   P=PIC16F84, R=DEC
                      00002         #INCLUDE "p16f84.inc"
                      00001         LIST
                      00002 ; P16F84.INC  Standard Header File, Version 2.00    Microchip Technology, Inc.
                      00136         LIST
                      00003 
                      00004 ;------------------------------------------------------------------------------
                      00005 ; ASSEMBLE With MPASM. available for free from http://www.microchip.com
                      00006 ;------------------------------------------------------------------------------
                      00007 ;
                      00008 ; Servo Controler Version 1.1
                      00009 ;       28/10/2001
                      00010 ;       - Fixed Serial receive data problem where the PIC could
                      00011 ;         miss a byte by assuming that the PC isn't in the middle of 
                      00012 ;         sending a byte as it deactivates CTS.
                      00013 ;
                      00014 ; This program will control 8 servos connected to PORT B of the
                      00015 ; PIC microcontroler.
                      00016 ;
                      00017 ; The servos work by responding to a pulse presented to them 
                      00018 ; approximately every 20ms. The width of the pulse controls the 
                      00019 ; position of the servo.
                      00020 ;
                      00021 ; In general, a pulse width of around 1520us is used as a neutral
                      00022 ; (centre) position indication. The pulse width is then increased
                      00023 ; or decreased from there. Generally it the pulse range goes from 
                      00024 ; 1 to 2 ms for full deflection (90 degree movement of horn.
                      00025 ;
                      00026 ; So we need to arrange timing to control the width of the output
                      00027 ; pulse. To do this we will run the PIC at 4MHz, this means that
                      00028 ; our instructions are 1us long (clock/4). We will arrange a delay
                      00029 ; loop to wait for a given number of clock cycles.
                      00030 ;
                      00031 ; Because servo aren't that accurate, we will divide the 1 to 2ms
                      00032 ; pulse range into 256 values, which if we work on a loop of 
                      00033 ; four instruction cycles we can get a loop between 4 and 1024 ms
                      00034 ; (the loop is constructed to run at least once)
                      00035 ;
                      00036 ; We then need to offset this (roughly) 0 to 1ms pulse to ensure
                      00037 ; that the servo is centered. We will do this by having an "offset"
                      00038 ; adjustment for each servo. This offset will control the width of
                      00039 ; the initial part of the pulse from 4 to 1024ms. This means that
                      00040 ; we can centre the servo using the offset and then move the servo
                      00041 ; +/-45 degrees from there. With careful use of the offset and
                      00042 ; position, it should be possible to use almost the full travel of
                      00043 ; the servo. 
                      00044 ;
                      00045 ; We will also need to be able to turn on and off the output of
                      00046 ; each servo driver.
                      00047 ;
                      00048 ; PORT B is configured:
                      00049 ;
                      00050 ;       RB0             Servo Control 0
MPASM  4.02 Released                             PICSERVO.ASM   12-31-2006  11:50:00         PAGE  2


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00051 ;       RB1             Servo Control 1
                      00052 ;       RB2             Servo Control 2
                      00053 ;       RB3             Servo Control 3
                      00054 ;       RB4             Servo Control 4
                      00055 ;       RB5             Servo Control 5
                      00056 ;       RB6             Servo Control 6
                      00057 ;       RB7             Servo Control 7
                      00058 ;
                      00059 ; PORT A is configured:
                      00060 ;
                      00061 ;       RA0             Serial TX (output)
                      00062 ;       RA1             Serial Request To Send (input)
                      00063 ;       RA2             Serial Clear To Send (output)
                      00064 ;       RA3             Serial RX (input)
                      00065 ;       RA4             LED Drive (0=on, 1=off. Used to indicate data transmission)
                      00066 ;
                      00067 ; Control Data
                      00068 ;
                      00069 ; To control the servos and outputs we need to send commands to the PIC.
                      00070 ; These commands will come from the serial port of a host computer running
                      00071 ; at 2400 baud, Hardware flow control (using CTS/RTS) with eight data bits,
                      00072 ; one stop bit and no parity. (2400 8-N-1).
                      00073 ;
                      00074 ; The commands take the format of one or two bytes sent sequentially 
                      00075 ; the first being the command to execute the second containing the data 
                      00076 ; for the command if needed.
                      00077 ;
                      00078 ; The command byte is split into two "nibbles". The upper 4 bits are used to
                      00079 ; determine the command, the lower 4 bits are used to select the output channel
                      00080 ;
                      00081 ;     +-----+-----+-----+-----+-----+-----+-----+-----+
                      00082 ; MSB |  7  |  6  |  5  |  4  |  3  |  2  |  1  |  0  | LSB
                      00083 ;     | 128 |  64 |  32 |  16 |  8  |  4  |  2  |  1  | Decimal Value
                      00084 ;     +-----+-----+-----+-----+-----+-----+-----+-----+
                      00085 ;     | Command               | Channel Select        |   
                      00086 ;     +-----+-----+-----+-----+-----+-----+-----+-----+
                      00087 ;
                      00088 ; Note that the value (in hex or decimal) is added to the channel number
                      00089 ; to generate the command byte.
                      00090 ; 
                      00091 ; The Commands are:
                      00092 ;
                      00093 ;       Hex             Decimal         Meaning
                      00094 ;       ---------------------------------------------------------------------------
                      00095 ;       0x00    0                       Reset Device. All outputs off, servos disabled and 
                      00096 ;                                               offset and position values set to 128 (mid range).
                      00097 ;                                               Data byte MUST BE Zero. The Channel Value MUST BE Zero.
                      00098 ;                                               Special, SHOULD be followed by another zero byte, see
                      00099 ;                                               text below.
                      00100 ;
                      00101 ;       0x10    16                      Set Servo Output "Positon Value". Data byte is the
                      00102 ;                                               value (between 0 and 255). The Channel Value must be
                      00103 ;                                               set in the lower 4 bits between 0 and 7.
MPASM  4.02 Released                             PICSERVO.ASM   12-31-2006  11:50:00         PAGE  3


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00104 ;
                      00105 ;       0x20    32                      Set Servo Output "Offset Value". Data byte is the 
                      00106 ;                                               value (between 0 and 255). The Channel Value must be
                      00107 ;                                               set in the lower 4 bits between 0 and 7.
                      00108 ;
                      00109 ;       0x30    48                      Enable Servo Output. This starts the PIC generating
                      00110 ;                                               servo control pulses on the given channel. The Channel 
                      00111 ;                                               Value must be set in the lower 4 bits between 0 and 7.
                      00112 ;                                               No Data byte.
                      00113 ;
                      00114 ;       0x40    64                      Disable Servo Output. This stops the PIC generating
                      00115 ;                                               servo control pulses on the given channel. The Channel 
                      00116 ;                                               Value must be set in the lower 4 bits between 0 and 7.
                      00117 ;                                               No Data byte.
                      00118 ;
                      00119 ;
                      00120 ; Parser State Control.
                      00121 ;
                      00122 ; Even with the hardware flow control where the PIC uses the CTS line to inhibit
                      00123 ; the host from sending more data when it can't receive it, there is a chance 
                      00124 ; the host and PIC will get out of step with commands and data bytes. This could
                      00125 ; occur because of either a bug in the host software or power being lost to the 
                      00126 ; PIC. This may result in the PIC attempting to treat a data byte as a command or
                      00127 ; a command as a data byte. Therefore some scheme is needed to ensure that the
                      00128 ; state of both can be quickly resynchronised.
                      00129 ;
                      00130 ; This will be done in two ways, the reset command and the rejection of unknown
                      00131 ; commands.
                      00132 ;
                      00133 ; If the PIC receives a byte it believes to be a command but is doesn't
                      00134 ; recognise the command, it will discard it and start looking for another
                      00135 ; command byte. This means that for more values of the data bytes it will
                      00136 ; ignore these as commands. Unfortunately not all however. It is therefore
                      00137 ; possible for the PIC to execute incorrent commands until it comes accross
                      00138 ; one that doesn't make sense. This means that it could skip a normal reset
                      00139 ; reset command if it was one byte long by reading it as a data byte.
                      00140 ;
                      00141 ; The reset command is two bytes long (a command and a data byte) both being
                      00142 ; zeros. However to ensure that the PIC is reset EVERY TIME the resent command
                      00143 ; it sent, it should be sent as THREE sequential zero bytes.
                      00144 ;
                      00145 ; The reason is that if the PIC is out of step and waiting for a data byte, it 
                      00146 ; will comsume the first zero as a data byte, take the next one as the command
                      00147 ; and the last one as the data byte. But what if it isn't out of sync? The
                      00148 ; parser in the PIC will know that a zero command requires a zero data byte
                      00149 ; to be valid, therefore it will receive the first zero as the command, the 
                      00150 ; second as the data and execute the reset. It will then get another zero byte
                      00151 ; which is the command for reset and be waiting for the corresponding zero data
                      00152 ; byte. However the host will start sending other valid command at this time
                      00153 ; and the parser will not receive a zero data byte. It then knows that it must
                      00154 ; discard the reset command and use the new byte as a command.
                      00155 ;
                      00156 
MPASM  4.02 Released                             PICSERVO.ASM   12-31-2006  11:50:00         PAGE  4


LOC  OBJECT CODE     LINE SOURCE TEXT
  VALUE

                      00157 ;+=============================================================================
                      00158 ;| Program Beginning.
                      00159 ;+=============================================================================
                      00160 
                      00161 ; Set the configuration, PUT Enabled, WDT Disabled, XT Oscillator, No Code Protection
                      00162 ;
2007   3FF1           00163         __CONFIG _XT_OSC & _PWRTE_ON & _WDT_OFF & _CP_OFF    
                      00164 
                      00165 
                      00166 ;+-----------------------------------------------------------------------------

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩成人伦理电影在线观看| 欧美日韩中文另类| 色先锋久久av资源部| 欧美一区二区三区视频在线| 亚洲六月丁香色婷婷综合久久| 天堂av在线一区| 99久久精品免费看| 日韩午夜av一区| 亚洲一区二区三区在线看| 国v精品久久久网| 欧美一区二区私人影院日本| 亚洲精品一二三| 国产91对白在线观看九色| 欧美精品久久久久久久久老牛影院| 国产精品无码永久免费888| 爽好久久久欧美精品| 色综合咪咪久久| 国产精品免费av| 欧美二区在线观看| 91精品国产高清一区二区三区蜜臀| 欧美一区二区三区免费观看视频 | 91超碰这里只有精品国产| 亚洲国产精品高清| 国模无码大尺度一区二区三区| 欧美在线视频不卡| 亚洲欧美激情小说另类| 国产成a人亚洲| 久久综合九色欧美综合狠狠| 免费观看成人av| 日韩精品最新网址| 美国十次了思思久久精品导航| 欧美区在线观看| 午夜精品久久久久久久久久| 欧美午夜在线一二页| 亚洲无线码一区二区三区| 色88888久久久久久影院按摩 | 精品国产一区二区三区久久久蜜月 | 欧美一区二区私人影院日本| 偷窥少妇高潮呻吟av久久免费 | 懂色av一区二区三区免费观看| 久久伊人中文字幕| 国产一区二区三区在线观看免费| 日韩你懂的电影在线观看| 午夜视频一区二区| 欧美精品免费视频| 免费xxxx性欧美18vr| 日韩亚洲国产中文字幕欧美| 国产一区欧美二区| 中文字幕不卡三区| 欧美最猛性xxxxx直播| 亚洲bt欧美bt精品| 日韩视频123| 粉嫩av一区二区三区在线播放| 国产精品久久综合| 欧美性色黄大片| 蜜桃视频一区二区三区在线观看| 精品国产99国产精品| 成人激情免费视频| 亚洲不卡av一区二区三区| 欧美一区二区三区日韩| 黄网站免费久久| 亚洲欧洲成人精品av97| 欧美蜜桃一区二区三区| 国产一区三区三区| 亚洲欧美另类小说视频| 日韩视频一区二区三区在线播放| 国产一区二区剧情av在线| 亚洲男人天堂av网| 日韩一区和二区| 成人黄色软件下载| 日本午夜精品视频在线观看 | 国产乱一区二区| 一区二区三区在线视频免费 | 在线中文字幕不卡| 久久精品国产亚洲5555| 国产精品不卡在线| 欧美r级在线观看| 日本高清不卡aⅴ免费网站| 激情成人综合网| 亚洲综合丁香婷婷六月香| 欧美精品一区男女天堂| 欧美视频在线观看一区| 国产999精品久久久久久绿帽| 亚洲不卡一区二区三区| 国产精品毛片大码女人| 精品欧美久久久| 欧美日韩高清一区二区| 成人高清视频免费观看| 久久超级碰视频| 亚洲成人av免费| 国产精品久久久久9999吃药| 欧美刺激午夜性久久久久久久| 在线观看一区二区精品视频| 不卡的看片网站| 国产一区91精品张津瑜| 丝袜国产日韩另类美女| 一区二区成人在线观看| 国产精品日产欧美久久久久| 久久一二三国产| 欧美人牲a欧美精品| 91黄色在线观看| a级高清视频欧美日韩| 国产东北露脸精品视频| 精品一区二区在线免费观看| 婷婷开心激情综合| 亚洲超碰精品一区二区| 亚洲图片自拍偷拍| 亚洲一区在线播放| 一区二区三区成人在线视频| 亚洲欧美国产77777| 成人欧美一区二区三区白人| 国产欧美日韩麻豆91| 久久精品亚洲精品国产欧美kt∨| 精品美女被调教视频大全网站| 欧美一级一级性生活免费录像| 欧美日韩久久一区| 欧美久久久久久蜜桃| 在线播放视频一区| 88在线观看91蜜桃国自产| 欧美日韩成人在线一区| 欧美久久久久久久久久| 欧美日韩国产首页| 91精品国产麻豆| 精品国产人成亚洲区| 精品福利视频一区二区三区| 久久久久国产精品麻豆| 国产日韩欧美麻豆| 国产精品欧美综合在线| 亚洲人吸女人奶水| 亚洲国产成人va在线观看天堂| 亚洲一区二区精品视频| 三级成人在线视频| 国产最新精品精品你懂的| 国产精品1区二区.| 99久久综合国产精品| 91国偷自产一区二区开放时间 | 亚洲欧美日韩精品久久久久| 一区二区三区中文字幕在线观看| 亚洲一区二区三区四区中文字幕| 亚洲成人激情自拍| 国内精品视频666| a4yy欧美一区二区三区| 欧美性色综合网| 久久先锋影音av| 亚洲精品视频一区二区| 国产精品一区久久久久| 色婷婷综合久色| 日韩欧美国产一区二区在线播放| 久久久午夜精品理论片中文字幕| 中文字幕永久在线不卡| 午夜视频在线观看一区二区 | 日韩主播视频在线| 国产a级毛片一区| 欧美在线小视频| 久久精品一区二区三区不卡牛牛| 樱花草国产18久久久久| 理论片日本一区| 91猫先生在线| 精品日韩在线观看| 亚洲美女一区二区三区| 韩国欧美国产一区| 欧美在线观看一区| 国产午夜精品久久久久久免费视| 亚洲综合另类小说| 成人小视频在线| 欧美一区二区三区日韩视频| 亚洲色图色小说| 国产福利不卡视频| 91精品国产综合久久香蕉的特点| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲香肠在线观看| 国产精品白丝av| 欧美一区二区三区免费在线看| 中文字幕中文乱码欧美一区二区| 麻豆精品在线播放| 欧美性一二三区| 亚洲欧洲色图综合| 国产成人免费高清| 日韩美女在线视频| 日韩精品一二区| 欧美在线播放高清精品| 国产精品毛片大码女人| 国产乱理伦片在线观看夜一区| 欧美一区二区三区爱爱| 亚洲成在人线在线播放| 99久久伊人久久99| 国产欧美久久久精品影院| 欧日韩精品视频| 亚洲日本在线a| 成av人片一区二区| 欧美精品一区二区三区蜜臀| 视频一区二区国产| 欧美日韩精品欧美日韩精品 | 久久久不卡网国产精品一区| 男女男精品网站| 3751色影院一区二区三区| 亚洲国产成人高清精品| 欧美日韩在线不卡| 午夜久久福利影院| 欧美日韩三级在线|