Welcome to my Last week blog here...T_T...i will miss u...
Week 15 ~ Last week of FYP and Submission of all report to supervisor...........
For the week 15 27/12 ( Friday). This is last week for FYP 2, and also need to submission the draft of final report and progress report to my supervisor. After that, need to do the hard cover and submission of final report to Resource Center.
.........................................................................................................................................
I would like to say Thank You very much to my Supervisor Assoc. Prof. Dr. Amir B. Abas to guide my project and teach me, i learn more knowledge from Dr. Thank You Dr.....^.^....
========================================================
Thank You reader start from week 1 till week 15........
If anything question just drop your comment here......
Miss U Guys.........Y^.^Y.....
The End of My FYP Blog here......
Saturday, 28 December 2013
Tuesday, 24 December 2013
FYP 2 : Week 14 ~ Industrial day
Welcome to my last 2 week blog here...Enjoy it...hehehe...^.^.....
Week 14 ~ Industrial day
For the week 14 20/12 ( Friday ). This week is Industrial day week, need to prepare to present and fight for top 20 also. Place of the presentation at Gemilang Hall and my table number is 47, so time from presentation is start from 9am. Before this is setup all the frame and last test project before present. Figure 1 is finished setup my project.
For each FYP 2 student, have 2 assesses will come and asses the project. Then my 2 assesses is Mdm. Nur Amalia Bt. Sapiee@ Hamdan and Sir. Azman B. Abdul Aziz@ Yusof. Both of my assesses is electronics department and asking electronic question and technical question. Also my project get select of Industrial and get assess from Mr. C K CHIN as Sales Manager from National Instruments Company.
During the presentation, need to explain more detail about project and explain using poster. After that, demo project to assesses and explain how the project function, then give more opinion about improve and innovate the project. Finally, after presentation need wait until 12.30pm to release result Top 20. Figure 2 is to shown the function of my project.
Thanks you to read my week 14 blog here.......
But don't forget to continue to read last week on next page......
Enjoy it....^.^.......
Week 14 ~ Industrial day
For the week 14 20/12 ( Friday ). This week is Industrial day week, need to prepare to present and fight for top 20 also. Place of the presentation at Gemilang Hall and my table number is 47, so time from presentation is start from 9am. Before this is setup all the frame and last test project before present. Figure 1 is finished setup my project.
Figure 1 : Place and Table for setup my project
For each FYP 2 student, have 2 assesses will come and asses the project. Then my 2 assesses is Mdm. Nur Amalia Bt. Sapiee@ Hamdan and Sir. Azman B. Abdul Aziz@ Yusof. Both of my assesses is electronics department and asking electronic question and technical question. Also my project get select of Industrial and get assess from Mr. C K CHIN as Sales Manager from National Instruments Company.
During the presentation, need to explain more detail about project and explain using poster. After that, demo project to assesses and explain how the project function, then give more opinion about improve and innovate the project. Finally, after presentation need wait until 12.30pm to release result Top 20. Figure 2 is to shown the function of my project.
Figure 2 : Fully function
When release result Top 20, i get into Top 20. So need to present again to Industrial Manager and Engineering and to fight for Top 1, 2 and 3. This is very experience for me to get in Top 20.
Thanks you to read my week 14 blog here.......
But don't forget to continue to read last week on next page......
Enjoy it....^.^.......
Sunday, 15 December 2013
FYP 2 : Week 13 ~ Design Poster and Finalize Project
Welcome to my last 3 week left blog here...hopefully enjoy it....
Week 13 ~ design poster and finalize the function of project.
For the week 13 13/12 ( Firday) is last 3 week. Week 13 is very important to finish all step of project which poster, frame of project and whole function of project. This is because next week is week 14 is Industrial day. For the poster design using software Microsoft office publisher and consists poster is introduction, objective, explanation device, process (blog diagram), result(output graph) and conclusion. Want more detail refer to figure 1 below.
Week 13 ~ design poster and finalize the function of project.
For the week 13 13/12 ( Firday) is last 3 week. Week 13 is very important to finish all step of project which poster, frame of project and whole function of project. This is because next week is week 14 is Industrial day. For the poster design using software Microsoft office publisher and consists poster is introduction, objective, explanation device, process (blog diagram), result(output graph) and conclusion. Want more detail refer to figure 1 below.
Figure 1: Poster to shown detail of Project
For the week 13 also i was to maked finalize about my project and make sure is function 100%. After that, test the project and to get the result or output from SD card. Then the important part is connection pin to pin, this is because pin of the microcontroller only have 4 pin which is RB0 till RB3 is interrupt pin. The pin RB0 and RB1 is connect to RFID reader, the RB2 is connect to storage switch and RB3 is connect to motion sensor output. Finally, is connect all the connection as figure 2 below.
Figure 2 : Connection of whole device
For the result is recorded is after connect whole the device and start test again. The result is get from SD card, the data is Hex code and need to convert to be decimal code. More detail can refer to figure 3 below.
Figure 3 : result of the project
Thanks for your support my log week 13....
And next week is week 14 also is a last week.....
Hopefully you get more information from my blog here.....Have A Nice Day...
Monday, 9 December 2013
FYP 2 : Week 12 ~ Design storage and LED circuit
WELCOME TO MY BLOG AGAIN....ENJOY IT....^.^...
Week 12 ~ Design storage circuit for my project.
For the week 12 ( 6/12) Friday.....
My project is less the circuit, that is storage circuit is use to save the all database into memory SD card after press the push button. The circuit is design consists few component which is 1x1k resister, 1x push button and smell size straight board. Construct the circuit first step is need to draw the schematic diagram then construct at straight board, put the push button then put the resister connect to GND.
After that, design the LED circuit, this is for to represent the motion sensor is turn ON or OFF and also to shown the motion sensor is function. When turn ON the supply the LED will turn it ON and blinking mean the motion sensor is turn on, and get ready to detect object. For the mode detail is when the LED blinking is motion sensor is turn high and low, if want to let motion sensor need to wait the LED turn OFF, this is because motion sensor is detect always high.
Week 12 ~ Design storage circuit for my project.
For the week 12 ( 6/12) Friday.....
My project is less the circuit, that is storage circuit is use to save the all database into memory SD card after press the push button. The circuit is design consists few component which is 1x1k resister, 1x push button and smell size straight board. Construct the circuit first step is need to draw the schematic diagram then construct at straight board, put the push button then put the resister connect to GND.
After that, design the LED circuit, this is for to represent the motion sensor is turn ON or OFF and also to shown the motion sensor is function. When turn ON the supply the LED will turn it ON and blinking mean the motion sensor is turn on, and get ready to detect object. For the mode detail is when the LED blinking is motion sensor is turn high and low, if want to let motion sensor need to wait the LED turn OFF, this is because motion sensor is detect always high.
Figure : To shown the circuit
Wahaha.......Finished read my blog....? If Yes......
Don't Forget read week 12 in next page.....
Thanks......^.^......Have a Nice day.....
Sunday, 1 December 2013
FYP 2 : Week 11 ~ FYP Briefing 2
Welcome to my blog week 11 here...hehehe...enjoy it....
Week 11 ~ FYP Briefing 2...........
For the week 11 29/11 ( Friday ). Is given FYP briefing 2 to degree and diploma student taken FYP 2. The briefing 2 set at TTL 1 and start from 4 pm-5p m. For the briefing 2 is handle by Mdm Zabariah Bt. Zakaria and Sir. Shamsul Zahari B Shahidin. The briefing is talk about the project demo preparation, design poster and final report.
Mdm Zabariah Bt. Zakaria explain detail about the project demo preparation to all student taken FYP 2. talk about the Industrial Day is fall on Friday, time is start from 8 am till 5.30 pm, but for degree session is start from 8am till 12.30pm and setup the project and booth is start 8 am till 9 am. Then start 9 am till 11 am is start assessor to asses student project and demo. After that, on 12.30pm is release Top 20 winner list and prepare to present to Industrial Manager. Lastly, start 2.00pm till 5.30pm is diploma session. Mdm also have mention again project presentation or demo is 35%.
Sir. Shamsul Zahari B Shahidin explain detail about how to design poster and how to present during industrial day. The poster Sir mention few important topic compulsory which is introduction, objective, methodology, result and conclusion. After that, Sir also have mention about colour of poster and format of poster. Also talk about submission form, metadata form and colour of hard cover that have 2 type colour one is dark green is for diploma and dark blue is for degree. Lastly, is talk about step of claim form of project, for the diploma max get claim is RM300 and degree max get claim is RM 500 only. After that, talk about project submission form is need to verify of supervisor and comment of supervisor.
Thanks for read my blog week 11.....
But don't forget to continuous to read week 12 next page....
Hahaha....^.^.....
Week 11 ~ FYP Briefing 2...........
For the week 11 29/11 ( Friday ). Is given FYP briefing 2 to degree and diploma student taken FYP 2. The briefing 2 set at TTL 1 and start from 4 pm-5p m. For the briefing 2 is handle by Mdm Zabariah Bt. Zakaria and Sir. Shamsul Zahari B Shahidin. The briefing is talk about the project demo preparation, design poster and final report.
Mdm Zabariah Bt. Zakaria explain detail about the project demo preparation to all student taken FYP 2. talk about the Industrial Day is fall on Friday, time is start from 8 am till 5.30 pm, but for degree session is start from 8am till 12.30pm and setup the project and booth is start 8 am till 9 am. Then start 9 am till 11 am is start assessor to asses student project and demo. After that, on 12.30pm is release Top 20 winner list and prepare to present to Industrial Manager. Lastly, start 2.00pm till 5.30pm is diploma session. Mdm also have mention again project presentation or demo is 35%.
Sir. Shamsul Zahari B Shahidin explain detail about how to design poster and how to present during industrial day. The poster Sir mention few important topic compulsory which is introduction, objective, methodology, result and conclusion. After that, Sir also have mention about colour of poster and format of poster. Also talk about submission form, metadata form and colour of hard cover that have 2 type colour one is dark green is for diploma and dark blue is for degree. Lastly, is talk about step of claim form of project, for the diploma max get claim is RM300 and degree max get claim is RM 500 only. After that, talk about project submission form is need to verify of supervisor and comment of supervisor.
Sample poster and Format poster
Thanks for read my blog week 11.....
But don't forget to continuous to read week 12 next page....
Hahaha....^.^.....
Saturday, 23 November 2013
FYP 2 : Week 10 ~ Test the project and finished the frame door
Welcome again to my blog here....So far week 10 now...^.^....
Week 10 ~ Test the hardware and during the frame door Supervisor office.
For the week 10 22/11( Friday). for the week 10 i very near for FYP project presentation, still have 4 week left, so test the hardware and bring the complete frame door to my Supervisor office to test the hardware and construct the frame door.
During the test the hardware, need make sure the connection between RFID reader and Controller. Very important is Pin VCC and Pin GND because if mistake to connect the controller hardware IC will be broke.
After that, wiring the motion sensor at top at the door, then the controller and the reader will put at the table.
Concept test the hardware is start from when the student scan the ID card at RFID reader, then the reader will transfer the data to controller will have control the LCD to display the date and time. After that, the controller will save the date and time at EEPROM memory. Then controller will turn On the motion sensor, waiting the student to across the door. After, student the across the door the motion sensor will detect the object, sent the data to the controller and controller will going to save the database into the mirco SD card. Lastly, take out the mirco Sd card put into the laptop the open the file as MIKRO00A to check attendance student date and time from the database.
For the first time test the program and the hardware, the program is working complete and the hardware also, but the problem is waiting time around 20s to turn On the motion sensor and that is too long time to use. After that, after detect from motion sensor also have to wait around 10s to save the database into the micro SD card. So need to change the time to be short and faster.
Refer the figure 1 to more detail about the hardware.
Refer to figure 2 to more detail about the frame door.
Thanks to view and read my blog here.....
Remember forget to continue to read following week....
Have a nice day and happy forever.....^.^....
Week 10 ~ Test the hardware and during the frame door Supervisor office.
For the week 10 22/11( Friday). for the week 10 i very near for FYP project presentation, still have 4 week left, so test the hardware and bring the complete frame door to my Supervisor office to test the hardware and construct the frame door.
During the test the hardware, need make sure the connection between RFID reader and Controller. Very important is Pin VCC and Pin GND because if mistake to connect the controller hardware IC will be broke.
After that, wiring the motion sensor at top at the door, then the controller and the reader will put at the table.
Concept test the hardware is start from when the student scan the ID card at RFID reader, then the reader will transfer the data to controller will have control the LCD to display the date and time. After that, the controller will save the date and time at EEPROM memory. Then controller will turn On the motion sensor, waiting the student to across the door. After, student the across the door the motion sensor will detect the object, sent the data to the controller and controller will going to save the database into the mirco SD card. Lastly, take out the mirco Sd card put into the laptop the open the file as MIKRO00A to check attendance student date and time from the database.
For the first time test the program and the hardware, the program is working complete and the hardware also, but the problem is waiting time around 20s to turn On the motion sensor and that is too long time to use. After that, after detect from motion sensor also have to wait around 10s to save the database into the micro SD card. So need to change the time to be short and faster.
Refer the figure 1 to more detail about the hardware.
Refer to figure 2 to more detail about the frame door.
Figure 2 : frame door
Thanks to view and read my blog here.....
Remember forget to continue to read following week....
Have a nice day and happy forever.....^.^....
Saturday, 16 November 2013
FYP 2 : Week 9 ~ Discuss with Supervisor Structural of the project.
Welcome to my Blog here.....hahaha...Enjoy it...
Week 9 ~ to discuss with Supervisor the structural of the project.
For the week 9 15/11 (Firday). I suggest the structural of the project as a frame door, this is because my project is student attendance system. Then the consent of the project is when a student using the id card to scan the RFID reader, the RDIF reader will receive the date from the student. After that, the date will sent to the controller system and display the touch screen button to touch. And then, the date will save into EEPROM such as micro SD card after student across the motion sensor. Lastly, can check the ID code from the student, date and time to scan.
So supervisor also agree my idea, and i will going to using the frame door material is PVC make it to be like a door shape. And the motion sensor will into the center door, easy to detect the student after scan the card. Refer the figure 1 to under more detail.
Thank you to read my blog here, hehe...
Remember to read week 10....hehehe
Have a nice day......Gambateh......
Week 9 ~ to discuss with Supervisor the structural of the project.
For the week 9 15/11 (Firday). I suggest the structural of the project as a frame door, this is because my project is student attendance system. Then the consent of the project is when a student using the id card to scan the RFID reader, the RDIF reader will receive the date from the student. After that, the date will sent to the controller system and display the touch screen button to touch. And then, the date will save into EEPROM such as micro SD card after student across the motion sensor. Lastly, can check the ID code from the student, date and time to scan.
So supervisor also agree my idea, and i will going to using the frame door material is PVC make it to be like a door shape. And the motion sensor will into the center door, easy to detect the student after scan the card. Refer the figure 1 to under more detail.
Figure 1 : Structural of PVC
Remember to read week 10....hehehe
Have a nice day......Gambateh......
Saturday, 2 November 2013
FYP 2 : Week 8 ~ Programming
Welcome to my blog here again.....Enjoy it....Gambateh...
Week 8 ~ Do the program for the project.
For the week 8 8/11 ( Friday).C language program is my main program for the project and i using MicroC Pro as the software to create my program. Refer the program below.
#include <built_in.h>
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
sbit OUT at RB1_bit;
sbit RDY_CLK at RB2_bit;
sbit SEN_MOV at RB3_bit;
sbit SHD at RB4_bit;
sbit MOD at RB5_bit;
sbit OUT_Direction at TRISB1_bit;
sbit RDY_CLK_Direction at TRISB2_bit;
sbit SEN_MOV_Direction at TRISB3_bit;
sbit SHD_Direction at TRISB4_bit;
sbit MOD_Direction at TRISB5_bit;
//char txt1[] = "RFID";
//char txt2[] = "MASUK";
//char txt3[] = "TUNGGU";char txt4[] = "SAVE";
unsigned short sync_flag,
one_seq, // counts the number of 'logic one' in series
data_in, // gets data bit depending on data_in_1st and data_in_2nd
cnt, k, M,
tmp, b, v, Save_Mem,
cnt1, cnt2; // auxiliary counters
unsigned short data_index; // marks position in data arrey
char i;
char _data[256], test[8];
char data_valid[64];
char bad_synch;
char seconds, minutes, hours, day, month, year;
void Interrupt() {
if (INT2IF_bit && INT2IE_bit) {
cnt++; // count interrupts on INT1 pin (RB1)
INT2IF_bit = 0;
}
else if (INT1IE_bit && INT1IF_bit) {
cnt = 0;
sync_flag = 1;
INT1IF_bit = 0;
INT1IE_bit = 0;
INT2IF_bit = 0;
INT2IE_bit = 1;
}
else if (INT3IE_bit && INT3IF_bit) {
Save_Mem = 1;
TMR0IE_bit = 0;
TMR0IF_bit = 0;
INT3IE_bit = 0;
INT3IF_bit= 0;
}
else if (TMR0IF_bit && TMR0IE_bit) {
Save_Mem = 1 ;
TMR0IE_bit = 0;
TMR0IF_bit = 0;
INT3IE_bit = 0;
INT3IF_bit= 0;
}
}
char CRC_Check(char *bit_array) {
char row_count, row_bit, column_count;
char row_sum, column_sum;
char row_check[5];
char column_check[11];
// row parity check:
row_count = 9; // count rows
while (row_count < 59) {
column_count = 0; // count columns
while (column_count < 5) {
row_check[column_count] = bit_array[row_count+column_count];
column_count++;
}
row_bit = 0; // count row bits
row_sum = 0;
while (row_bit < 4) {
row_sum = row_sum + row_check[row_bit];
row_bit++;
}
if (row_sum.B0 != row_check[4].B0) {
return 0;
}
row_count = row_count + 5;
}
// end row parity check
// column parity check
column_count = 9; // count columns
while (column_count < 13) {
row_bit = 0; // count column bits
row_count = 0; // count rows
while (row_bit < 11) {
column_check[row_bit] = bit_array[column_count+row_count];
row_bit++;
row_count = row_count + 5;
}
row_bit = 0; // count column bits
column_sum = 0;
while (row_bit < 10) {
column_sum = column_sum + column_check[row_bit];
row_bit++;
}
if (column_sum.B0 != column_check[10].B0) {
return 0;
}
column_count++;
}
// end column parity check
if (bit_array[63] == 1) {
return 0;
}
return 1;
}
void Transform_RTC() {
seconds = ((seconds & 0xF0) >> 4)*10 + (seconds & 0x0F);
minutes = ((minutes & 0xF0) >> 4)*10 + (minutes & 0x0F);
hours = ((hours & 0xF0) >> 4)*10 + (hours & 0x0F);
year = (day & 0xC0) >> 6;
day = ((day & 0x30) >> 4)*10 + (day & 0x0F);
month = ((month & 0x10) >> 4)*10 + (month & 0x0F);
}
void Read_RTC() {
I2C1_Start(); // Issue start signal
I2C1_Wr(0xA0); // Address PCF8583, see PCF8583 datasheet
I2C1_Wr(2); // Start from address 2
I2C1_Repeated_Start(); // Issue repeated start signal
I2C1_Wr(0xA1); // Address PCF8583 for reading R/W=1
seconds = I2C1_Rd(1);
minutes = I2C1_Rd(1);
hours = I2C1_Rd(1);
day = I2C1_Rd(1);
month = I2C1_Rd(0);
I2C1_Stop(); // Issue stop signal
day = day & 0x3F; // Re-format day data
}
//-------------------- Output values to LCD
void Display_RTC() {
Lcd_Chr(1, 6, (day / 10) + 48); // Print tens digit of day variable
Lcd_Chr(1, 7, (day % 10) + 48); // Print oness digit of day variable
Lcd_Chr(1, 9, (month / 10) + 48);
Lcd_Chr(1,10, (month % 10) + 48);
Lcd_Chr(1,15, year + 49); // Print year variable + 8 (start from year 2008)
Lcd_Chr(2, 6, (hours / 10) + 48);
Lcd_Chr(2, 7, (hours % 10) + 48);
Lcd_Chr(2, 9, (minutes / 10) + 48);
Lcd_Chr(2,10, (minutes % 10) + 48);
Lcd_Chr(2,12, (seconds / 10) + 48);
Lcd_Chr(2,13, (seconds % 10) + 48);
}
//------------------ Performs project-wide init
void Init_RTC() {
I2C1_Init(100000); // Initialize Soft I2C communication
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear LCD display
Lcd_Cmd(_LCD_CURSOR_OFF); // Turn cursor off
Lcd_Out(1,1,"Date:"); // Prepare and output static text on LCD
Lcd_Chr(1,8,':');
Lcd_Chr(1,11,':');
Lcd_Out(2,1,"Time:");
Lcd_Chr(2,8,':');
Lcd_Chr(2,11,':');
Lcd_Out(1,12,"201");
}
//void Display_Intro(){
//Lcd_Init();
//Lcd_Cmd(_LCD_CLEAR);
//Lcd_Cmd(_LCD_CURSOR_OFF);
//Lcd_Out(1,6,txt3);
//Lcd_Out(2,6,txt4);
// Delay_ms(2000);
// Lcd_Cmd(_LCD_CLEAR);
// Lcd_Out(1,1,txt1);
// Lcd_Out(2,5,txt2);
// Delay_ms(2000);
//}
// main program
void main() {
ADCON1 = 0x0F; // AD converter off
CMCON = 7;
k = 0;
OUT_Direction = 1; // RFID TX
RDY_CLK_Direction = 1; // RFID RX
SEN_MOV_Direction = 1; // motion sensor
SHD_Direction = 0; // RFID
MOD_Direction = 0; // RFID
//TrisB0_bit = 1;
Init_RTC(); // Initialize Clock
SHD = 0;
MOD = 0;
Lcd_Init ();
//Display_Intro() ;
UART1_Init(19200); // Initialise USART communication
Delay_ms(100);
UART1_Init(19200);
sync_flag = 0; // sync_flag is set when falling edge on RB0 is detected
one_seq = 0; // counts the number of 'logic one' in series
data_in = 0; // gets data bit
data_index = 0; // marks position in data arrey
cnt = 0; // interrupt counter
cnt1 = 0; // auxiliary counter
cnt2 = 0; // auxiliary counter
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,6,"RFID CLOCK IN"); // Write text in first row
delay_ms(2000);
Lcd_Cmd(_LCD_CLEAR); // Clear display
// setup interrupts
INTEDG1_bit = 0; // Interrupt on falling edge on RB0
INTEDG2_bit = 1; // Interrupt on rising edge on RB1
INT1IF_bit = 0; // Clear INT0IF
INT2IF_bit = 0; // Clear INT1IF
// INT1IP_bit = 1;
// INT2IP_bit = 1;
INT1IE_bit = 0; // turn OFF interrupt on INT0
INT2IE_bit = 0; // turn OFF interrupt on INT1
//Int0IE_bit = 1;
GIE_bit = 1; // enable GIE
M = 0;
while (1) {
bad_synch = 0; // set bad synchronization variable to zero
cnt = 0; // reseting interrupt counter
sync_flag = 0; // reseting sync flag
INT2IF_bit = 0;
INT2IE_bit = 0; // disable external interrupt on RB1 (for sync and sample)
INT1IF_bit = 0;
INT1IE_bit = 1; // enable external interrupt on RB0 (start sync procedure)
//GIE_bit = 1;
T0CON = 0b10000101; // Timer0 Control Register
while (sync_flag == 0) { // waiting for falling edge on RB0
Read_RTC(); // Read time from RTC(PCF8583)
Transform_RTC(); // Format date and time
Display_RTC(); // waiting for card reader. while waiting
asm nop // display shows actual time
}
while (cnt != 16) { // waiting 16 clocks on RB1 (positioning for sampling)
asm nop // waiting for 16 bit data after card reader being touched
}
cnt = 0;
_data[0] = OUT & 1;
for (data_index = 1; data_index != 0; data_index++) { // getting 128 bits of data from RB0
while (cnt != 32) { // getting bit from RB0 every 32 clocks on RB1
asm nop
}
cnt = 0; // reseting interrupt counter
_data[data_index] = OUT & 1; // geting bit
if(data_index & 1)
if (!(_data[data_index] ^ _data[data_index-1]))
{
bad_synch = 1;
break; //bad synchronisation
}
}
INT2IE_bit = 0; // disable external interrupt on RB1 (for sync and sample)
if (bad_synch)
continue; // try again
cnt1 = 0;
one_seq = 0;
for(cnt1 = 0; cnt1 <= 127; cnt1++) { // we are counting 'logic one' in the data array
if (_data[cnt1 << 1] == 1) {
one_seq++;
}
else {
one_seq = 0;
}
if (one_seq == 9) { // if we get 9 'logic one' we break from the loop
break;
}
} // (the position of the last 'logic one' is in the cnt1)
if ((one_seq == 9) && (cnt1 < 73)) { // if we got 9 'logic one' before cnt1 position 73
// we write that data into data_valid array
data_valid[0] = 1; // (it has to be before cnt1 position 73 in order
data_valid[1] = 1; // to have all 64 bits available in data array)
data_valid[2] = 1;
data_valid[3] = 1;
data_valid[4] = 1;
data_valid[5] = 1;
data_valid[6] = 1;
data_valid[7] = 1;
data_valid[8] = 1;
for(cnt2 = 9; cnt2 <= 63; cnt2++) { // copying the rest of data from the data array into data_valid array
cnt1++;
data_valid[cnt2] = _data[cnt1 << 1];
}
if (CRC_Check(data_valid) == 1) { // if data in data_valid array pass the CRC check
UART1_Write_Text("CRC CHECK OK!"); // Writing of the CRC Check confirmation through USART communication
M = M + 1;
UART1_Write(13); // Cariage return (view ASCII chart)
UART1_Write(10); // Line Feed (view ASCII chart)
for (i = 0; i <= 64; i++){ // This part of the code
k = k + 1; // dislays the number of the specific RfID CARD
if (data_valid[i] == 0) {
Uart1_Write('0');
}
else {
Uart1_Write('1'); // at the end of this for loop you will get a string of "0" and "1"
}
}
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,6,"WAIT"); // wait for motion sensor timer
//delay_ms (2000);
// Clear display
b = 0; v = 0;
for (v = 0; v < 8; v++) { // save code and time in memory
for (i = 0; i < 8; i++){ // MMC not ready.
// this part will be used to
tmp = tmp ^ data_valid[i + 8*v]<<i; // slot memory sub-routine
}
test[v] = tmp;
// b = b + 1;
TMR0IF_bit = 0; // activate Timer interupt
TMR0IE_bit = 1;
INT3IE_bit = 1;
INT3IF_bit= 0; // activate motion sensor
while (Save_Mem == 0) { // waiting signal from timer or motion
// if student did not pass thru the motion sensor
asm nop // in 3 min the timer int is activated
}
Lcd_Cmd(_LCD_CLEAR); // clear display and restart the new card reader
Save_Mem = 0;
}
// specific to a single RfID CARD
UART1_Write(13); // Cariage return (view ASCII chart)
UART1_Write(10); // Line Feed (view ASCII chart)
Delay_ms(500);
}
}
}
}
This is my complete program for my project that is student attendance system, but have to download to PIC 18F87k22 at controller hardware. PIC 18F87K22 is more faster when compile and download the program into PIC. After that, i will going to test the program and the hardware on week 10.
Thank you to read my blog here....
Remember read week 9 and 10, because have any difference....hahaha.....
Have a nice day.....
Week 8 ~ Do the program for the project.
For the week 8 8/11 ( Friday).C language program is my main program for the project and i using MicroC Pro as the software to create my program. Refer the program below.
#include <built_in.h>
sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
sbit OUT at RB1_bit;
sbit RDY_CLK at RB2_bit;
sbit SEN_MOV at RB3_bit;
sbit SHD at RB4_bit;
sbit MOD at RB5_bit;
sbit OUT_Direction at TRISB1_bit;
sbit RDY_CLK_Direction at TRISB2_bit;
sbit SEN_MOV_Direction at TRISB3_bit;
sbit SHD_Direction at TRISB4_bit;
sbit MOD_Direction at TRISB5_bit;
//char txt1[] = "RFID";
//char txt2[] = "MASUK";
//char txt3[] = "TUNGGU";char txt4[] = "SAVE";
unsigned short sync_flag,
one_seq, // counts the number of 'logic one' in series
data_in, // gets data bit depending on data_in_1st and data_in_2nd
cnt, k, M,
tmp, b, v, Save_Mem,
cnt1, cnt2; // auxiliary counters
unsigned short data_index; // marks position in data arrey
char i;
char _data[256], test[8];
char data_valid[64];
char bad_synch;
char seconds, minutes, hours, day, month, year;
void Interrupt() {
if (INT2IF_bit && INT2IE_bit) {
cnt++; // count interrupts on INT1 pin (RB1)
INT2IF_bit = 0;
}
else if (INT1IE_bit && INT1IF_bit) {
cnt = 0;
sync_flag = 1;
INT1IF_bit = 0;
INT1IE_bit = 0;
INT2IF_bit = 0;
INT2IE_bit = 1;
}
else if (INT3IE_bit && INT3IF_bit) {
Save_Mem = 1;
TMR0IE_bit = 0;
TMR0IF_bit = 0;
INT3IE_bit = 0;
INT3IF_bit= 0;
}
else if (TMR0IF_bit && TMR0IE_bit) {
Save_Mem = 1 ;
TMR0IE_bit = 0;
TMR0IF_bit = 0;
INT3IE_bit = 0;
INT3IF_bit= 0;
}
}
char CRC_Check(char *bit_array) {
char row_count, row_bit, column_count;
char row_sum, column_sum;
char row_check[5];
char column_check[11];
// row parity check:
row_count = 9; // count rows
while (row_count < 59) {
column_count = 0; // count columns
while (column_count < 5) {
row_check[column_count] = bit_array[row_count+column_count];
column_count++;
}
row_bit = 0; // count row bits
row_sum = 0;
while (row_bit < 4) {
row_sum = row_sum + row_check[row_bit];
row_bit++;
}
if (row_sum.B0 != row_check[4].B0) {
return 0;
}
row_count = row_count + 5;
}
// end row parity check
// column parity check
column_count = 9; // count columns
while (column_count < 13) {
row_bit = 0; // count column bits
row_count = 0; // count rows
while (row_bit < 11) {
column_check[row_bit] = bit_array[column_count+row_count];
row_bit++;
row_count = row_count + 5;
}
row_bit = 0; // count column bits
column_sum = 0;
while (row_bit < 10) {
column_sum = column_sum + column_check[row_bit];
row_bit++;
}
if (column_sum.B0 != column_check[10].B0) {
return 0;
}
column_count++;
}
// end column parity check
if (bit_array[63] == 1) {
return 0;
}
return 1;
}
void Transform_RTC() {
seconds = ((seconds & 0xF0) >> 4)*10 + (seconds & 0x0F);
minutes = ((minutes & 0xF0) >> 4)*10 + (minutes & 0x0F);
hours = ((hours & 0xF0) >> 4)*10 + (hours & 0x0F);
year = (day & 0xC0) >> 6;
day = ((day & 0x30) >> 4)*10 + (day & 0x0F);
month = ((month & 0x10) >> 4)*10 + (month & 0x0F);
}
void Read_RTC() {
I2C1_Start(); // Issue start signal
I2C1_Wr(0xA0); // Address PCF8583, see PCF8583 datasheet
I2C1_Wr(2); // Start from address 2
I2C1_Repeated_Start(); // Issue repeated start signal
I2C1_Wr(0xA1); // Address PCF8583 for reading R/W=1
seconds = I2C1_Rd(1);
minutes = I2C1_Rd(1);
hours = I2C1_Rd(1);
day = I2C1_Rd(1);
month = I2C1_Rd(0);
I2C1_Stop(); // Issue stop signal
day = day & 0x3F; // Re-format day data
}
//-------------------- Output values to LCD
void Display_RTC() {
Lcd_Chr(1, 6, (day / 10) + 48); // Print tens digit of day variable
Lcd_Chr(1, 7, (day % 10) + 48); // Print oness digit of day variable
Lcd_Chr(1, 9, (month / 10) + 48);
Lcd_Chr(1,10, (month % 10) + 48);
Lcd_Chr(1,15, year + 49); // Print year variable + 8 (start from year 2008)
Lcd_Chr(2, 6, (hours / 10) + 48);
Lcd_Chr(2, 7, (hours % 10) + 48);
Lcd_Chr(2, 9, (minutes / 10) + 48);
Lcd_Chr(2,10, (minutes % 10) + 48);
Lcd_Chr(2,12, (seconds / 10) + 48);
Lcd_Chr(2,13, (seconds % 10) + 48);
}
//------------------ Performs project-wide init
void Init_RTC() {
I2C1_Init(100000); // Initialize Soft I2C communication
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear LCD display
Lcd_Cmd(_LCD_CURSOR_OFF); // Turn cursor off
Lcd_Out(1,1,"Date:"); // Prepare and output static text on LCD
Lcd_Chr(1,8,':');
Lcd_Chr(1,11,':');
Lcd_Out(2,1,"Time:");
Lcd_Chr(2,8,':');
Lcd_Chr(2,11,':');
Lcd_Out(1,12,"201");
}
//void Display_Intro(){
//Lcd_Init();
//Lcd_Cmd(_LCD_CLEAR);
//Lcd_Cmd(_LCD_CURSOR_OFF);
//Lcd_Out(1,6,txt3);
//Lcd_Out(2,6,txt4);
// Delay_ms(2000);
// Lcd_Cmd(_LCD_CLEAR);
// Lcd_Out(1,1,txt1);
// Lcd_Out(2,5,txt2);
// Delay_ms(2000);
//}
// main program
void main() {
ADCON1 = 0x0F; // AD converter off
CMCON = 7;
k = 0;
OUT_Direction = 1; // RFID TX
RDY_CLK_Direction = 1; // RFID RX
SEN_MOV_Direction = 1; // motion sensor
SHD_Direction = 0; // RFID
MOD_Direction = 0; // RFID
//TrisB0_bit = 1;
Init_RTC(); // Initialize Clock
SHD = 0;
MOD = 0;
Lcd_Init ();
//Display_Intro() ;
UART1_Init(19200); // Initialise USART communication
Delay_ms(100);
UART1_Init(19200);
sync_flag = 0; // sync_flag is set when falling edge on RB0 is detected
one_seq = 0; // counts the number of 'logic one' in series
data_in = 0; // gets data bit
data_index = 0; // marks position in data arrey
cnt = 0; // interrupt counter
cnt1 = 0; // auxiliary counter
cnt2 = 0; // auxiliary counter
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,6,"RFID CLOCK IN"); // Write text in first row
delay_ms(2000);
Lcd_Cmd(_LCD_CLEAR); // Clear display
// setup interrupts
INTEDG1_bit = 0; // Interrupt on falling edge on RB0
INTEDG2_bit = 1; // Interrupt on rising edge on RB1
INT1IF_bit = 0; // Clear INT0IF
INT2IF_bit = 0; // Clear INT1IF
// INT1IP_bit = 1;
// INT2IP_bit = 1;
INT1IE_bit = 0; // turn OFF interrupt on INT0
INT2IE_bit = 0; // turn OFF interrupt on INT1
//Int0IE_bit = 1;
GIE_bit = 1; // enable GIE
M = 0;
while (1) {
bad_synch = 0; // set bad synchronization variable to zero
cnt = 0; // reseting interrupt counter
sync_flag = 0; // reseting sync flag
INT2IF_bit = 0;
INT2IE_bit = 0; // disable external interrupt on RB1 (for sync and sample)
INT1IF_bit = 0;
INT1IE_bit = 1; // enable external interrupt on RB0 (start sync procedure)
//GIE_bit = 1;
T0CON = 0b10000101; // Timer0 Control Register
while (sync_flag == 0) { // waiting for falling edge on RB0
Read_RTC(); // Read time from RTC(PCF8583)
Transform_RTC(); // Format date and time
Display_RTC(); // waiting for card reader. while waiting
asm nop // display shows actual time
}
while (cnt != 16) { // waiting 16 clocks on RB1 (positioning for sampling)
asm nop // waiting for 16 bit data after card reader being touched
}
cnt = 0;
_data[0] = OUT & 1;
for (data_index = 1; data_index != 0; data_index++) { // getting 128 bits of data from RB0
while (cnt != 32) { // getting bit from RB0 every 32 clocks on RB1
asm nop
}
cnt = 0; // reseting interrupt counter
_data[data_index] = OUT & 1; // geting bit
if(data_index & 1)
if (!(_data[data_index] ^ _data[data_index-1]))
{
bad_synch = 1;
break; //bad synchronisation
}
}
INT2IE_bit = 0; // disable external interrupt on RB1 (for sync and sample)
if (bad_synch)
continue; // try again
cnt1 = 0;
one_seq = 0;
for(cnt1 = 0; cnt1 <= 127; cnt1++) { // we are counting 'logic one' in the data array
if (_data[cnt1 << 1] == 1) {
one_seq++;
}
else {
one_seq = 0;
}
if (one_seq == 9) { // if we get 9 'logic one' we break from the loop
break;
}
} // (the position of the last 'logic one' is in the cnt1)
if ((one_seq == 9) && (cnt1 < 73)) { // if we got 9 'logic one' before cnt1 position 73
// we write that data into data_valid array
data_valid[0] = 1; // (it has to be before cnt1 position 73 in order
data_valid[1] = 1; // to have all 64 bits available in data array)
data_valid[2] = 1;
data_valid[3] = 1;
data_valid[4] = 1;
data_valid[5] = 1;
data_valid[6] = 1;
data_valid[7] = 1;
data_valid[8] = 1;
for(cnt2 = 9; cnt2 <= 63; cnt2++) { // copying the rest of data from the data array into data_valid array
cnt1++;
data_valid[cnt2] = _data[cnt1 << 1];
}
if (CRC_Check(data_valid) == 1) { // if data in data_valid array pass the CRC check
UART1_Write_Text("CRC CHECK OK!"); // Writing of the CRC Check confirmation through USART communication
M = M + 1;
UART1_Write(13); // Cariage return (view ASCII chart)
UART1_Write(10); // Line Feed (view ASCII chart)
for (i = 0; i <= 64; i++){ // This part of the code
k = k + 1; // dislays the number of the specific RfID CARD
if (data_valid[i] == 0) {
Uart1_Write('0');
}
else {
Uart1_Write('1'); // at the end of this for loop you will get a string of "0" and "1"
}
}
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,6,"WAIT"); // wait for motion sensor timer
//delay_ms (2000);
// Clear display
b = 0; v = 0;
for (v = 0; v < 8; v++) { // save code and time in memory
for (i = 0; i < 8; i++){ // MMC not ready.
// this part will be used to
tmp = tmp ^ data_valid[i + 8*v]<<i; // slot memory sub-routine
}
test[v] = tmp;
// b = b + 1;
TMR0IF_bit = 0; // activate Timer interupt
TMR0IE_bit = 1;
INT3IE_bit = 1;
INT3IF_bit= 0; // activate motion sensor
while (Save_Mem == 0) { // waiting signal from timer or motion
// if student did not pass thru the motion sensor
asm nop // in 3 min the timer int is activated
}
Lcd_Cmd(_LCD_CLEAR); // clear display and restart the new card reader
Save_Mem = 0;
}
// specific to a single RfID CARD
UART1_Write(13); // Cariage return (view ASCII chart)
UART1_Write(10); // Line Feed (view ASCII chart)
Delay_ms(500);
}
}
}
}
This is my complete program for my project that is student attendance system, but have to download to PIC 18F87k22 at controller hardware. PIC 18F87K22 is more faster when compile and download the program into PIC. After that, i will going to test the program and the hardware on week 10.
Thank you to read my blog here....
Remember read week 9 and 10, because have any difference....hahaha.....
Have a nice day.....
Saturday, 26 October 2013
FYP 2 : Week 6 ~ Solder the pin on microcontroller hardware
Welcome to my Blog again here....Wahahaha...Enjoy It...
Week 6 ~ Solder connection board and Jumper
For the week 6 25/11(Friday). Supervisor told me have to solder connection board between controller and the RTC2, After that, also want solder jumper as have bottom pin, because easy to connect between the port controller and port RFID reader. And then, need to solder the pin on controller hardware also.
Then i going to Jalan Pasar, buy the wire and the pin. After that, solder the connection board also use resistor on pin 3 and pin 4. Refer to figure 1 below.
Week 6 ~ Solder connection board and Jumper
For the week 6 25/11(Friday). Supervisor told me have to solder connection board between controller and the RTC2, After that, also want solder jumper as have bottom pin, because easy to connect between the port controller and port RFID reader. And then, need to solder the pin on controller hardware also.
Then i going to Jalan Pasar, buy the wire and the pin. After that, solder the connection board also use resistor on pin 3 and pin 4. Refer to figure 1 below.
figure 1
For the controller hardware also need to solder the pin as top at beside the hardware. Refer to figure 2 below is doing the soldering, figure 3 is finished solder.
figure 2 : doing soldering
figure 3 : finished solder
Lastly, is construct the pin into the jumper as bottom jumper. Refer the figure 4 below.
figure 4 : doing construction
Thank You for view and read my Blog here.....
Remember to read week 7 blog here again...^.^.....Have a nice day....
Saturday, 12 October 2013
FYP 2 : Week 5 ~ Research function of Hardware and Circuit diagram of Hardware
Welcome again to read my blog here...Enjoy it, hope u get some idea....^.^.....
Week 5 ~ Receive the Hardware and Try the Hardware
For the week 5 11/10 ( Friday). Receive 6 hardware list in week 4, such as Smart G LCD, RFID reader, RFID card, motion sensor, RTC2 and Microcontroller. After that, understand the function of each hardware and circuit diagram.
1. The SmartGLCD 240x128 is a compact smart display, with many on-board peripherals. It’s designed to become a control interface of your device. Main part of the board is a large 240x128 pixel graphical LCD with a 4-wire restive touch screen. Refer the circuit diagram below.
Week 5 ~ Receive the Hardware and Try the Hardware
For the week 5 11/10 ( Friday). Receive 6 hardware list in week 4, such as Smart G LCD, RFID reader, RFID card, motion sensor, RTC2 and Microcontroller. After that, understand the function of each hardware and circuit diagram.
1. The SmartGLCD 240x128 is a compact smart display, with many on-board peripherals. It’s designed to become a control interface of your device. Main part of the board is a large 240x128 pixel graphical LCD with a 4-wire restive touch screen. Refer the circuit diagram below.
2. Microcontroller. The heart of the board is PIC18F87K22, an 8-bit microcontroller delivering 12MIPS of processing power. Other modules like USB UART, piezo buzzer, microSD slot and connection pads can be found on board as well. The board is preprogrammed with UART bootloader. Refer the circuit diagram for each function on below.
Circuit of USB UART
Circuit of piezo buzzer
Circuit of Micro SD card
3. Motion Sensor
4. RTC2 ( Read Time Clock)
5. RFID reader.
The RFID is a small electronic devices that consist of a small chip and an antenna. The chip typically is
capable of carrying 2,000 bytes of data or less. The RFID device serves the same purpose as a bar code
or a magnetic strip on the back of a credit card or ATM card; it provides a unique identifier for that
object. And, just as a bar code or magnetic strip must be scanned to get the information, the RFID
device must be scanned to retrieve the identifying information.
Thanks for view and read my blog here.......
But remember read coming soon week 6 on next page.....
Wish U HaPPy ForEver.....Yeah~~~
Friday, 4 October 2013
FYP 2 : Week 4 ~ Order the Hardware
Welcome to my blog here....Enjoy it...Y^.^....
Week 4 ~ Order the hardware
For the week 4 4/11(Friday). Discuss with Supervisor and make sure the all hardware is suitable for my project.
Hardware list:
1. Smart G LCD touch screen
2. RF-ID reader
3. RTC 2
4. Smart Card
5. Motion Sensor
6. Microcontroller
Thanks for read my blog and don't forget continue to read week 5 on next page....
Wish all the best for you....yeah yeah...Y^.^Y......
Week 4 ~ Order the hardware
For the week 4 4/11(Friday). Discuss with Supervisor and make sure the all hardware is suitable for my project.
Hardware list:
1. Smart G LCD touch screen
3. RTC 2
4. Smart Card
5. Motion Sensor
6. Microcontroller
Thanks for read my blog and don't forget continue to read week 5 on next page....
Wish all the best for you....yeah yeah...Y^.^Y......
Subscribe to:
Posts (Atom)




























