PML's Blog (3)

Sample codes for stepper motor

list p=16f877                 ; list directive to define processor      

#include <p16f877.inc>        ; processor specific variable definitions    

 __CONFIG _CP_OFF & _WDT_OFF & _BODEN_ON & _PWRTE_ON & _HS_OSC & _WRT_ENABLE_ON & _CPD_OFF & _LVP_ON

 

 

cblock 0x20

 COUNTH

  COUNTM

  COUNTL

endc



         ORG       0x0000     ;RESET vector must…

Continue

Added by PML on January 19, 2011 at 10:46pm — No Comments

Introduction to Serial Communications (RS232)

All IBM PC and compatible computers are typically equipped with two serial ports and one parallel port. Although these two types of ports are used for…

Continue

Added by PML on August 14, 2010 at 2:00pm — No Comments

Converting 2-Digit Hex to Decimal ASCII Code for Display

Some times it is desired to convert a 2-bit hex code into decimal ASCII code.


For example, MCU processes hex number. If the user wishes to display the value code of a counter in a MCU, a conversion to decimal ASCII code will be required. Other wise, when the counter goes up to "11", the actual value in the MCU would be 0x0A, and the corresponding ASCII characters that will be displayed are "0 :"


The following code converts a hex value to decimal…
Continue

Added by PML on July 21, 2010 at 6:00pm — No Comments

© 2024   Created by PML.   Powered by

Badges  |  Report an Issue  |  Terms of Service