Showing posts with label Software. Show all posts
Showing posts with label Software. Show all posts

Thursday, 1 July 2010

4x4 Metrix Keypad

Matrix Keypad (4x4, 3x4, 3x3 ) ေတြကို ေနရာစံုမွာ သံုးၾကပါတယ္။ ဖုန္း ေတြရဲ့ ေတြ အျဖစ္၊ ေတြရဲ့ ေတြအျဖစ္ သံုးၾကပါတယ္။ ခုေျပာခ်င္တာက ဒီေကာင္ေလးရဲ့ တည္ေဆာက္ပံုနဲ႔ Matrix Keypad ရဲ့ သေဘာတရားပါ။ ႐ိုး႐ိုးေလး ေတြးၾကည့္လိုက္ရင္ 16 Keys (4x4) ကို scan လုပ္ဖို႔အတြက္ Input pin ၁၆ ခု လိုပါတယ္။ Input (whole 8 bits port) ေတြ အဲ့ေလာက္အမ်ားႀကီး မသံုးႏိုင္ေတာ့တဲ့အခါ Software controlled matrix Keypad ကို သံုးၾကပါတယ္။

ေအာက္က ပံုေတြမွာ Schematic ေကာ Keypad ပံုစံေတြပါ ျပထားပါတယ္။ Software controlled logic ကေတာ့ ..
၁။ ၄ လိုင္းစီ (4 Outputs and 4 Inputs) ထားပါ။ Row, Column ႀကိဳက္သလို ထားလို႔ရပါတယ္။
၂။ Output ၁ လိုင္းစီကေန logic (High/ Low) ေပးပါ။ ၁ လိုင္းေပးတိုင္း Input 4 lines လံုးကို scan ပါ။ ၁ လိုင္းမိတာနဲ႔ ထြက္ပစ္လိုက္ပါ။
ဥပမာ - Output 1 and Input 1 ဆိုရင္ Row 1, Col 1 ဆိုေတာ့ “Key 1"
Output 2 and Input 3 ဆိုရင္ Row 2, Col 3 ဆိုေတာ့ “Key 6"။ အဲလိုနည္းစနစ္နဲ႔ ေရးသြားပါတယ္။
၃။ Key Bonce ကို ေျဖာက္ခ်င္ယင္ေတာ့ ၂ ခါျပန္ scan လုပ္ၿပီး တူတယ္ဆိုမွ အဲ့ဒီ Key ကို ယူပါ။ ေအာက္မွာ နမူနာ source code ထဲ့ေပးထားပါတယ္။


#include //Include file for 8051
#define keyport P2 //keypad connected to P2
#define col1 P2_0 //column 1
#define col2 P2_1 //column 2
#define col3 P2_2 //column 3
#define col4 P2_3 //column 4
#define TRUE 1 //some defines
#define FALSE 0

/*
+---------------------------------------+
| Prototype: void key_init(void); |
| Return Type: void |
| Arguments: None |
| Description: Initialize ports and |
| Keypad. |
+---------------------------------------+
*/
void key_init(){
keyport &=0x0F; //make Rows as o/p and cols are i/p
}

/*
+-----------------------------------------------+
| Prototype: unsigned char get_key(void); |
| Return Type: unsigned char |
| Arguments: None |
| Description: To read key from the keypad |
+-----------------------------------------------+
*/
unsigned char get_key(){
unsigned char i,k,key=0;
k=1;
for(i=0;i<4;i++){>
keyport &=~(0x80>>i); //to make rows low 1 by 1
if(!col1){ //check if key1 is pressed
key = k+0; //set key number
while(!col1); //wait for release
return key; //return key number
}
if(!col2){ //check if key2 is pressed
key = k+1; //set key number
while(!col2); //wait for release
return key; //return key number
}
if(!col3){ //check if key3 is pressed
key = k+2; //set key number
while(!col3); //wait for release
return key; //return key number
}
if(!col4){ //check if key4 is pressed
key = k+3; //set key number
while(!col4); //wait for release
return key; //return key number
}
k+=4; //next row key number
keyport |= 0x80>>i; //make the row high again
}
return FALSE; //return false if no key pressed
}

Saturday, 13 February 2010

RCM5400W ေနာက္ဆက္တြဲ (၁)

RCM54XX ေတြရဲ့အားသာခ်က္က Zworld http mini server ေလးထဲ့လို႔ရပါတယ္။ ဒါေပမယ့္ အဲ့ဒီ Server ရဲ့ Foot Print က အေတာ္ႀကီးတဲ့အတြက္ တစ္ကယ္တမ္း အေသအေၾကသံုးၾကစတမ္းဆိုရင္ Storage Area မ်ားတဲ့ (၂ ဆ၊ ေစ်းလည္း ပိုပါတယ္) RCM5450 လိုေကာင္နဲ႔မွ အဆင္ေျပလိမ့္မယ္။ က်ေတာ္သံုးတဲ့ ပံုစံက FTP server ကို အဲဒီထဲမွာ ထဲ့ၿပီးေတာ့ Wireless Filer Transfer ေလာက္ပါပဲ။ http server ကို သံုးဖို႔ စဥ္းစားေပမယ့္လည္း Port forwarding ကိတ္စေတြမွာ ျပသနာရွိေနတဲ့အတြက္ တိုက္႐ိုက္ Data Access လုပ္တဲ့နည္းကို ေမ့ပစ္ၿပီး FTP နည္းစံနစ္ကို သံုးလိုက္ရတာပါ။

အားသာခ်က္ ေနာက္တစ္ခုက Embedded WiFi Module ျဖစ္တဲ့အတြက္ DHCP ကိုသံုးလို႔ရပါတယ္။ အရင္ 3700 ကေတာ့ Static IP ပဲ အဆင္ေျပပါတယ္။

Ref : http://www.rabbit.com/products/rcm5400W/


Monday, 16 February 2009

RTC, Timer And External Oscillator

RTC နဲ႔ TIMER ေတြ အေၾကာင္းကို ကၽြန္ေတာ္ ခဏခဏ ေရးေလ့ရွိပါတယ္။ အခုေျပာျပခ်င္တာက RTC ကို Timer နဲ႔ေရးတဲ့အခါ လိုအပ္တဲ့ လိုအပ္ခ်က္ေတြပါ။ အမ်ားအားျဖင့္ RTC သံုးခ်င္တဲ့အခါ External RTC chip ကိုသံုးေလ့ ရွိၾကပါတယ္။ ဒါေပမယ့္ Hardware overload ကိုေလွ်ာ့ခ်ခ်င္တဲ့ အခါမွာျဖစ္ျဖစ္၊ Boom Price ကိုေလွ်ာ့ခ်င္တဲ့အခါမွာ ျဖစ္ျဖစ္ RTC ကို routine ေရးၿပီးသံုးၾကပါတယ္။

အဲဒီအခါမွာ Timer တစ္ခုကို သံုးၿပီး ေရးရပါတယ္။ ေအာက္မွာ RTC ေရးရတဲ့ Assembly source codeကို ျပထားပါတယ္။ C language အျဖစ္လည္း ေျပာင္းၿပီးေရးလို႔ရပါတယ္။ ဒါေပမယ့္ RTC routine အမ်ားစုကို Assembly ေရးေလ့ရွိပါတယ္။ Instruction cycle ကိုေလွ်ာ့ခ်ခ်င္လို႔ပါ။

အဲလို ေရးတဲ့အခါမွာ Timer ရဲ႕ အခ်ိန္ကို တိက်ေအာင္ External Crystal (Oscillator) တစ္ခုကို ခ်ိတ္ဆက္ေပးရပါတယ္။ ေအာက္မွာ ျပထားတာကေတာ့ Timer1 ကိုသံုးၿပီးေတာ့ RTC routine ကိုေရးတဲ့အခါ လိုအပ္တဲ့ Crystal ခ်ိတ္ဆက္ေပးရတဲ့ ပံုပါ။



Monday, 29 December 2008

Double Head (Double Auger) Powder Filler

ပံုမွန္ Powder Filler က Head တစ္ခုတည္းနဲ႔ 2 Speed သံုးၿပီး အမႈန္႔ေတြကို ျဖည့္ေလ့ရွိတယ္။ First နဲ႔ Second speed ေပါ့။ Normal speed နဲ႔ Prelim speed လို႔ ေခၚတာေပါ့။ Double Head (Auger) က်ေတာ့ အဲဒီသေဘာကိုပဲ Head ႏွစ္ခုခြဲလုပ္တာပါ။ Calculation နဲ႔ Processing (speed change) time ကို က်သြားေအာင္လုပ္တာေပါ့။ ပထမ head က Normal speed ပဲျဖည့္တယ္။ ဒုတိယ head က Second speed နဲ႔ဆက္ျဖည့္တာပါပဲ။ Container ၂ခုကို တစ္ၿပိဳင္နက္ျဖည့္တာေပါ့။ Conveyor (Assembly line) ေပၚမွာအလုပ္လုပ္မွ အဆင္ေျပႏိုင္ပါတယ္။



Tuesday, 9 December 2008

Short Notes (2)

Active Low အတြက္ Signal ကို Scope နဲ႔ဖတ္တဲ့အခါမွာ Low ျဖစ္တဲ့ Pulse ကိုပဲ ဖတ္ရၿပီးေတာ့ Active High အတြက္ဆိုရင္ High ျဖစ္တဲ့ Pulse ကိုဖတ္ရပါတယ္ Pulse ကိုဖတ္တဲ့အခါမွာလည္း One Cycle အျပည့္ကို ဖတ္လို႔မရပါဘူး။ ဖတ္ခဲ့ရင္ Pulse Rate (Frequency) ရသြားမွာပါ။ Pulse (Time) ကိုလိုခ်င္တဲ့အတြက္ Pulse (Low/ High) ျဖစ္သြားတဲ့ အခ်ိန္ေလးကိုပဲ ဖတ္ပါ။

Monday, 24 November 2008

Electronics E-Books Series (2)

Electronic စာအုပ္ လက္က်န္ေတြ ထပ္တင္ေပးလိုက္ပါတယ္။









Thursday, 23 October 2008

Load Cell Degitizing Unit (LDU 78.1) for Weighting Machine

ဒီပစၥည္းက Weighting Machine ေတြမွာပဲ သံုးတဲ့ပစၥည္းပါ။ ၁ x ၂ လက္မ ပတ္လည္ပဲ ရွိပါတယ္။ သူရဲ႕လုပ္ငန္းကေတာ့ Weighter နဲ႔ PLC or MCU ၾကားမွာ အေလးခ်ိန္ကို တြက္ခ်က္ ေဖၚျပေပးတဲ့ အလုပ္ပါပဲ။ High Precision Measuremment Tool တစ္ခုပါ။ ကၽြန္ေတာ္သံုးတဲ့ Load Cell Unit က FLINTEC/ SOEMER ပါ။ Germany (EU) က ထုတ္ပါတယ္။ သူက RS-485 Communication ကိုပဲ လုပ္ေပးတာပါ။ ဒါေပမယ့္ MCU နဲ႔ သံုးတဲ့အခါမွာ RS-232 ကိုပဲ အလုပ္လုပ္တဲ့အတြက္ converter (adaptor) တစ္ခုထပ္ထည့္ေပးရပါတယ္။ အဲဒီ Converter က ပံုမွာျပထားတဲ့ အစိမ္းေရာင္ ေအာက္ခံေလးပါ။ ပံုကိုၾကည့္မယ္ဆိုရင္ ဘယ္ဘက္ပိုင္းက Weighter နဲ႔ ဆက္ရၿပီးေတာ့ ညာဘက္ပိုင္းက Power supply, MCU/ PLC ေတြနဲ႔ ဆက္ရပါတယ္။ သူ႔မွာ Firmware သပ္သပ္ပါတဲ့အတြက္ command level communication လည္းလုပ္လို႔ရပါတယ္။ PC's HyperTerminal ဒါမွမဟုတ္ သူ႔ရဲ႕သက္ဆိုင္ရာ software (DOP program) ကိုသံုးရင္လည္း ရပါတယ္။

Monday, 20 October 2008

PIC18F4420 Timer Module (8 bit/ 16 bit)

Timer ေတြနဲ႔ပါတ္သတ္တဲ့ ပို႔စ္ေတြေတာ့ တင္ဘူးပါတယ္။ ခုေရးမွာက Datasheet ေတြမွာပါတဲ့ Block Diagram ကိုဖတ္ၿပီး Timer ရဲ႕အလုပ္လုပ္ပံုကို ေလ့လာတဲ့ သေဘာပါ။ ေအာက္မွာ ကၽြန္ေတာ္ျပထားတာက 8 bit နဲ႔ 16 bit Timer ရဲ႕ Diagram ေတြပါ။
ထံုးစံအတိုင္း ဘယ္ကေန ညာကို စဖတ္မယ္ဆိုရင္ -
၁။ Timer ရဲ႕ speed က Oscillator (External) ရဲ႕ ၄ ပံုတစ္ပံု ရွိပါတယ္။ အဲဒါကို Timer interrupt နဲ႔ တစ္ၿပိဳင္နက္ ON ပါတယ္။ Interrupt က Pin (Hardware) ဒါမွမဟုတ္ Software interrupt ရွိပါမယ္။
၂။ Prescaler သံုးရင္ Prescaler အတြက္ Ratio ထည့္တြက္ပါတယ္။
၃။ Internal clock က Timer interval အတြက္ သံုးပါတယ္။ သံုးတဲ့ Register ကေတာ့ datasheet ကေန ထပ္ေလ့လာရပါတယ္။
၄။ TM0L က Tick တန္ဖိုးတစ္ခုပါ။ Tick ေပါင္း 00 FF (256) အထိရပါတယ္။ 8 bit ျဖစ္ေနလို႔ပါ။ TM0H မွာၾကည့္လိုက္ရင္ 16 bit ရတဲ့အတြက္ FF FF (65535) tick အထိ ထည့္ေပးလို႔ရပါတယ္။ ပိုၿပီး interval ရွည္လို႔ရတဲ့ သေဘာေပါ့။
ဒါက PIC18F4420 MCU အတြက္သံုးတဲ့ Timer Routine ပါ။
အထက္က အဆင့္ေတြအတိုင္း ေရးရင္ Timer sub routine ကိုရမွာပါ။ ေရးတာကေတာ့ compiler ေပၚမူတည္ၿပီး လြယ္တာ ခက္တာေတာ့ ရွိပါလိမ့္မယ္။



Saturday, 20 September 2008

Programming with Touch Panel

Touch Panel အေၾကာင္းကို ပို႔စ္တစ္ခုမွာေတာ့ ေရးဘူးပါတယ္။ Touch Panel ေတြမွာ Program ေရးတဲ့အခါမွာ Protocol တစ္ခုကို ကိုယ္တိုင္ဖန္တီးယူရပါတယ္။ Microcontroller ေတြကို သံုးပီး Low level နဲ႔ software ေရးရင္ေပါ့။ PLC နဲ႔တြဲသံုးမယ္ဆိုရင္ေတာ့ PLC ေတြမွာ support လုပ္တဲ့ dedicated protocol အမ်ိဳးအစားကို ေရြးခ်ယ္ေပး႐ံုပါပဲ။ တကယ္ေတာ့ Touch Panel ေတြက PLC ေတြအတြက္ အဓိကထားၿပီး ထုတ္ထားတဲ့အတြက္ MCU ေတြနဲ႔ေရးတဲ့အခါ ေတြမွာ handshaking ျပသနာတက္ေလ့ရွိပါတယ္။ ကၽြန္ေတာ္အရင္က TOP2M touch panel ကိုသံုးပါတယ္။ သူ႔မွာက program routine အေနနဲ႔သက္သက္ေရးလို႔မရပဲ Register ေလးေတြကို setting ခ်ေပးလိုက္ပီး communication ေတြလုပ္ပါတယ္။ အခုသံုးေနတဲ့ Delta ကေတာ့ program routine ေတြကိုေရးလို႔ရပါတယ္။ VB source code ေတြနဲ႔ ခပ္ဆင္ဆင္ပါပဲ။ ဒါေပမယ့္ ျပသနာက MCU ကေန Direct Memory addressing လုပ္လို႔မရတဲ့အတြက္ data read/ write လုပ္တဲ့အခါမွာ အခက္အခဲေတြေတြ႔ပါတယ္။ အခုေလာေလာဆယ္ေတာ့ အဲဒါနဲ႔ေခါင္းကိုက္ေနပါတယ္။ သက္ဆိုင္ရာကုမ္ပနီရဲ႕ AE နဲ႔ေတာ့ အဆက္အသြယ္လုပ္ ထားပါတယ္။ ျပန္ေတာ့မေျဖေသးဘူး။ ကၽြန္ေတာ့္အထင္ေတာ့ direct memory addressing မရရင္ ျဖစ္ႏိုင္မယ္မထင္ပါဘူး။



Thursday, 4 September 2008

Electronics E-Books Series (1)

အရင္ကေတာ့ တစ္ခ်ိဳ႕တစ္၀က္ေတြကို တင္ထားပါေသးတယ္။ Electronic နဲ႔ပါတ္သတ္တဲ့ စာအုပ္ေတြပါပဲ။ လင့္ခ္ေတြ ေသကုန္လို႔ စာရင္းေတြ ျပန္တင္ေပးလိုက္တာပါ။ ထံုးစံအတိုင္း အီးေမးလ္ကေနပဲ ပို႔ေပးပါမယ္။ စီေဘာက္စ္မွာ ေတာင္းခဲ့ၾကပါ။

Monday, 25 August 2008

PIC Microcontrollers Projects Samples

PIC Microcontroller ေတြနဲ႔ပါတ္သတ္တဲ့ နမူနာ Project ကေလးေတြပါတဲ့ Website ေလးပါ။ Source COde, Hardware Assembly ေတြပါထည့္ေရးထားလို႔ အဆင္ေျပမွာပါ။

http://www.micro-examples.com

Wednesday, 16 July 2008

External Memory using I2C Serial EEPROM

နဲနဲအစပ်ိဳးပါဦးမယ္။ ကၽြန္ေတာ္တို႔ Microcontroller program ေရးတဲ့အခါ memory သံုးရပါတယ္။ ၂ မ်ိဳးသံုးေလ့ရွိပါတယ္။ On-Chip နဲ႔ External Memory ပါ။ On-Chip က MCU ထဲမွာ ပါၿပီးေတာ့ External က အျပင္မွာသပ္သပ္ထပ္ထည့္တဲ့ Memory ပါ။ ကြန္ပ်ဴတာမွာဆိုရင္ေတာ့ Cache နဲ႔ RAM သေဘာေပါ့။ ကၽြန္ေတာ္ ေျပာမွာက External Memory အေၾကာင္းပါ။ သူ႔မွာ application ေပၚမူတည္ၿပီး အမ်ိဳးအစားေတြကြဲေလ့ရွိပါတယ္။ SD, EEPROM, Flash ဆိုၿပီးရွိၾကပါတယ္။ protocol (I2C, SPI, UART) ေတြလည္းကြဲၾကပါတယ္။ ခုဟာက I2C protocol ကိုသံုးၿပီးေတာ့ ေရးရတဲ့ EEPROM အေၾကာင္းပါ။

သူ႔မွာ operation ၂ မ်ိဳးပဲပါပါတယ္။ Read နဲ႔ Write ေပါ့။ ေအာက္မွာ Read/ Write operation ေတြရဲ႕ Data Frame ပံုစံေတြျပထားပါတယ္။ I2C protocol အေၾကာင္းကိုေတာ့ ထပ္ေျပာပါဦးမယ္။


Friday, 11 July 2008

Bittorrent protocol with Free Download Manager

RSJ က Cbox မွာေရးသြားလို႔ တစ္ခုသတိရ သြားတယ္။ Torrent နဲ႔ပါတ္သတ္လို႔ ဆက္ေရးစရာ နည္းနည္းရွိလို႔ပါ။ Bittorrent ဆိုတဲ့ Software ကိုသံုးလို႔ရတယ္လို႔ အရင္ပို႔စ္မွာ ကၽြန္ေတာ္ေရးခဲ့ပါတယ္။ Bittorrent က Bandwidth ေတြကို ရႏိုင္သမွ်ဆြဲၿပီး သူ႔ Software မွာသံုးတဲ့အတြက္ တစ္ခါတစ္ေလမွာ Whole Network (LAN) ႀကီး breakdown ျဖစ္သြားတတ္ပါတယ္။ အဲဒီေတာ့ အေကာင္းဆံုးနည္းက Free Download Manager ကိုသံုးၿပီး bittorrent protocol ကို ျပန္သံုးပါ။ FDM ကို Install လုပ္တဲ့အခါမွာ bittorrent protocol ကိုသံုးမလားဆိုတဲ့ Checkbox ေလးပါပါတယ္။ အဲဒါကို checked လုပ္ေပးလိုက္႐ံုပါပဲ။ သူ႔ကိုသံုးမည့္ bandwidth ကိုလည္း သတ္မွတ္ေပးထားလို႔ရေတာ့ LAN ႀကီး breakdown မျဖစ္ေတာ့ဘူးေပါ့။ ပံုမွန္ speed (စင္ကာပူ ရဲ႕ Internet Speed နဲ႔ဆို) 600 MB ေလာက္ကို တစ္ရက္ခြဲေလာက္ပဲ ၾကာပါတယ္။ Health ေကာင္းတဲ့ torrent ဆိုရင္ေပါ့။ Health ဆိုတာ Seeder နဲ႔ Leecher ရဲ႕ ratio ပါ။ Leecher က ဆြဲတဲ့သူျဖစ္ၿပီး၊ Seeder က တင္တဲ့သူေတြပါ။ torrent ေတြကို ေႏွာက္ယွက္တဲ့ Tracker ဆိုတာလည္းရွိပါေသးတယ္။ ေတြ၀င္လာရင္ torrent ေတြ download လုပ္ေနရင္းနဲ႔ ျပတ္က်သြားတတ္ပါတယ္။ အဲလိုဆိုရင္ ေနာက္ torrent တစ္ခုထပ္ရွာၿပီး ဆြဲရပါတယ္။

Download Free Download Manager :

Monday, 30 June 2008

Pulse Width Modulation (PWM) with Rabbit 3000 MCU

PWM (Pulse Width Modulation) ကို ေနာက္ပိုင္း MCU ေတြမွာ ေတာ္ေတာ္ေတြ႕လာရပါတယ္။ ကၽြန္ေတာ္အခုျပမွာက Rabbit 3000 နဲ႔ပါ။ အရင္ကၽြန္ေတာ္သံုးခဲ့တဲ့ MCU ေတြ Cygnal, NEC, ARM မွာ ဒီ function မပါတဲ့အတြက္ Timer ေတြ၊ Interrupt ေတြနဲ႔ ႐ႈပ္ေနေအာင္တြက္ရ ေရးခဲ့ရပါတယ္။ ၿပီးေတာ့ Time interval တိက်မႈလည္း မရွိပါဘူး။ ဒီ PWM function ကေတာ့ interval တိက်မႈရွိတဲ့အျပင္ Duty Cycle ကိုလည္း လိုအပ္သလို (%) နဲ႔ထုတ္ေပးလို႔ရပါတယ္။ တကယ္ေတာ့ MCU ေတြရဲ႕အားသာခ်က္ပါသလို compiler (core module) ေတြရဲ႕စြမ္းရည္ကလည္း အရမ္းျမင့္လာလို႔ပါ။ ဒီမွာ pwm_set ၄ ခါေရးရတာကေတာ့ Rabbit 3000 မွာ PWM Channel ၄ ခုပါတဲ့အတြက္ျဖစ္ပါတယ္။ Duty cycle တစ္မ်ိဳးစီနဲ႔ ေရးျပထားတာပါ။

void main()
{
unsigned long freq;
int pwm_options;

// request 10kHz PWM cycle (will select closest possible value)
freq = pwm_init(10000);
printf("Actual PWM frequency = %d Hz\n", freq);
pwm_options = 0;
pwm_set(0, 0.10 * 1024, pwm_options);

pwm_set(1, 0.25 * 1024, pwm_options);
pwm_set(2, 0.50 * 1024, pwm_options);
pwm_set(3, 0.99 * 1024, pwm_options);
while(1); //keep running the program

}


Thursday, 19 June 2008

M2I TOP2 Touch Screen Interface Programming (1)

Touch Panel (Screen) ကိုျမင္ဖူး သံုးဖူးၾကလိမ့္မယ္ထင္တယ္။ ကၽြန္ေတာ္ေျပာမွာက Touch Panel ကိုသံုးၿပီး Microcontroller Interface ေရးတဲ့ပံုစံကိုပါ။ သူ႔ က Application program လိုလဲမဟုတ္၊ Embedded program နဲ႔လည္း သိပ္မတူဘူး။ Application လို Intercafe ေတြ create ရၿပီးေတာ့ Embedded လို Memory address, Register ေတြကိုသံုးၿပီးေရးပါတယ္။ ကၽြန္ေတာ္တို႔ သံုးတာက M2I TOP2 Touch Panel ပါ။ အျဖဴနဲ႔ တစ္ျခားတစ္ေရာင္ Monochrome ပဲရပါတယ္။ Microcontroller Interface ပိုင္းကေတာ့ RS232 ပါ။ PC Interface ကေတာ့ download သက္သက္အတြက္ပဲ သံုးပါတယ္။ RS232 န႔ဲပါပဲ။ သူ႔မွာ Main Menu တစ္ခုပါၿပီးေတာ့။ Program Mode ဆိုရင္ေတာ့ အဲဒီ Menu ကို ေျဖာက္ထားလို႔ရပါတယ္။ Baud Rate ကိုလည္း Program Runtime အတြင္းမွာ ေျပာင္းသံုးလို႔ရပါတယ္။ Software Reset ေတာ့ လုပ္ေပးရပါတယ္။

Wednesday, 9 April 2008

PIC Microcontroller Reference Books

ဒီစာအုပ္ေတြက PIC Microcontroller နဲ႔ပါတ္သတ္ၿပီး။ Hardware, Software, Configuration ေတြအေၾကာင္း အကုန္ပါပါတယ္။ Assembly ေရာ၊ C language ေရာနဲ႔ျပထားတာေတြပါ။ ျမန္မာဘာသာျပန္ၿပီးထားတဲ့ စာအုပ္တစ္အုပ္လည္း ပါမယ္ထင္တယ္။ PIC MCU အေၾကာင္းအျပည့္အစံု ပါပါတယ္။ 8 bit MCU ေရာ၊ 16 bit MCU ေရာအတြက္ ေရးထားတာေတြပါ။

PIC 8051 Microcontrollers
Interfacing PIC Microcontrollers
PIC Microcontroller Project Book by John Lovine
Programming 16-Bit PIC Microcontrollers in C
Embedded C tutorial 8051

စာအုပ္ေတြကို ေ၀မွ်တဲ့သူက “ေမာင္သန္႔” ပါ။

Thursday, 3 April 2008

Parallel Port Monitor Program

ဒီ Software ေလးက Parallel port ကို Monitor လုပ္တဲ့ Program ေလးပါ။ port ရဲ႕ ဘယ္ bit မွာ Data (Low/ High) ရွိလဲဆိုတာကို ျပတာပါ။ Monitor program သက္သက္ပဲျဖစ္လို႔ Hyper Terminal လိုေတာ့ Send/ Receive data လုပ္လို႔မရဘူးေပါ့။
Download : Port Monitor

Tuesday, 1 April 2008

Controlling Parallel port with Visual Basic

Visual Basic နဲ႔ Parallel Port (LPT, Printer) ကို Control (Read, Write) လုပ္တဲ့ ပ႐ိုဂရမ္ေလးပါ။ ေမ့သြားမွာစိုးလို႔ တင္ထားတာ။ သူ႔မွာ VB Control Icon (.OCX) မရွိပါဘူး။ inpout32.dll file တစ္ခုေတာ့လိုပါတယ္။ အဲဒါက သပ္သပ္ရွာၿပီး Windows – System32 folder ထဲကိုထည့္ေပးရပါတယ္။ အင္တာနက္မွာ အမ်ားႀကီးရွိပါတယ္။ ဒီမွာ www.dll-files.com/dllindex/dll-files.shtml?inpout32 ေဒါင္းလုပ္ရင္ရပါတယ္။ သူ႔ကို System32 folder ထဲထည့္ေပးလုိက္ပါ။ ၿပီးရင္ေအာက္က Source code ေတြကို ကူးထည့္လိုက္ပါ။ Screen Design ကိုေတာ့ ေအာက္မွာျပထားတဲ့အတိုင္းလုပ္ေပါ့။ အရမ္းလြယ္ပါတယ္။ အခ်ိန္ေတြတြက္ထားတာက အပိုေတြပါ။ ျဖဳတ္ပစ္လို႔ရတယ္။

ဒါက Form Code မွာကူးထဲ့

Private Sub send_Click()

PortAddress = Val(&H37F)
Out PortAddress, Val(Text1.Text)
End Sub

Private Sub start_click()
Dim speed As Double
Dim fre As Double
Text1.Text = "0"

Dim ino As Integer
Dim GMTime As SYSTEMTIME
Dim TheTime As String
Dim a As Double, b As Double
GetSystemTime GMTime

a = GMTime.wSecond + 0.001 * GMTime.wMilliseconds
For x = 1 To 10000
PortAddress = Val(&H378)

ino = InValue(PortAddress + 1)
Next

GetSystemTime GMTime
Timer1.Interval = 1
b = GMTime.wSecond + 0.001 * GMTime.wMilliseconds
speed = 0.127 / (b - a)

Text1.Text = speed
End Sub

Private Sub stop_click()
Text1.Text = "0"
End Sub

ဒါက Module Code မွာကူးထဲ့

Public Declare Function InValue Lib "inpout32.dll" _
Alias "Inp32" (ByVal PortAddress As Integer) As Integer
Public Declare Sub Out Lib "inpout32.dll" _
Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
Public Declare Sub GetSystemTime Lib "kernel32" (lpSystemTime As SYSTEMTIME)
Public Declare Function SetSystemTime Lib "kernel32" (lpSystem
Time As SYSTEMTIME) As Long

Public Type SYSTEMTIME
wYear As Integer
wMonth As Integer

wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer

wSecond As Integer
wMilliseconds As Integer

End Type

အဲဒီမွာပါတဲ့ (&H378) က Parallel port ရဲ႕ Address ပါ။ သူက 8 Channels ရွိပါတယ္။ ေအာက္ကပံုကိုၾကည့္ပါ။ 0x378 ကေန 0x37F ဆိုေတာ့ I/O ၈ လုိင္းကို ထိန္းခ်ဳပ္လို႔ရတဲ့သေဘာေပါ့။

Wednesday, 26 March 2008

Magic ISO

Torrents ေတြကိုသံုးၿပီး အင္တာနက္ကေန Software ေတြကို Download လုပ္တဲ့အခါ .ISO ဆိုတဲ့ Extension နဲ႔ ဖိုင္ေလးတစ္ခုပဲ ရလာတတ္ပါတယ္။ အဲဒါကတကယ္ေတာ့ CD/ DVD တစ္ခုလံုးကို Package လုိက္ Download လုပ္လိုက္တဲ့ သေဘာပါပဲ။ သူ႔ကိုျပန္ဖြင့္ဖို႔ဆိုရင္ Magic ISO ဆိုတဲ့ Software လိုပါတယ္။ ေအာက္မွာျပထားတဲ့ အတိုင္း File ဖြင့္ၿပီး Extract လုပ္ေပးလိုက္ပါ။ အဲဒါမွ Install လုပ္လို႔ရပါလိမ့္မယ္။ တကယ္လို႔ CD/ DVD အျဖစ္လိုခ်င္တယ္ဆိုရင္ေတာ့ အဲဒီ ဖိုင္ေလးကို တန္းၿပီး Burn လုိက္လို႔ရပါတယ္။ Unregistered ျဖစ္ေနတဲ့အတြက္ Extract အရင္ လုပ္ၿပီးမွ Burn လုိက္တာေကာင္းပါတယ္။

Magic ISO

Tuesday, 25 March 2008

Thermal Head (NEC 515 MCU) Software Files

ဘာမွမဟုတ္ပါဘူး NEC 515 MCU နဲ႔ေရးထားတဲ့ Software ေလးကို ေမ့သြားမွာစိုးလို႔ တင္ထားတာပါ။

ThermalHead Main Program
Mecha 2 Arm Program
Mecha 3 Arm Program