Page 1 of 2

PR29 Modification ? HELP

PostPosted: Mon Nov 08, 2010 6:19 pm
by Noobie
How to modify the product schematic to interface with PC using serial port DB9 instead of passing through UART then UC00A?

Re: PR29 Modification ?

PostPosted: Mon Nov 08, 2010 8:41 pm
by shahrul
If you are using UART-to-USB converter, it's operate with UART, so you can connect directly to pin RC6 and RC7.

Re: PR29 Modification ?

PostPosted: Mon Nov 08, 2010 9:46 pm
by ober
Noobie WROTE:How to modify the product schematic to interface with PC using serial port DB9 instead of passing through UART then UC00A?


You want to bypass using UC00A? In other words, is using conventional method, the RS232 DB9 serial port? Then you need to have a RS232 level shifter. try to search for MAX232 circuit. This might be helpful:
Image

If you look carefully, MAX232 require four connection from microcontroller board: 5V, GnD, TX and RX which you can get it from the standard connector which originally UC00A being connected.

Re: PR29 Modification ?

PostPosted: Mon Nov 08, 2010 10:22 pm
by Noobie

Re: PR29 Modification ? HELP

PostPosted: Mon Nov 08, 2010 10:56 pm
by hyng
Ober has shown you the useful schematic. I'm not sure if it will work when you connect to the software UART pins which is RC0 and RC1. But you can give it a try. No modification on the programming is needed in this case.

Re: PR29 Modification ?

PostPosted: Mon Nov 08, 2010 11:15 pm
by shahrul
Noobie WROTE:so if i want to modify that part to communicate with PC using RS232-DB9 serial port.
can i just pull the RC0,RC1 to MAX232 pin 11(T1in), 12(R1out)?
or must use the RC6, RC7? what about the connection with the fingerprint module?
require any code modification on programming the PIC16F876A ?

Did you mean, you want to interface fingerprint module and connected to PC at same project? Then you must use multi-uart program.

Re: PR29 Modification ? HELP

PostPosted: Mon Nov 08, 2010 11:52 pm
by Noobie
hyng WROTE:Ober has shown you the useful schematic. I'm not sure if it will work when you connect to the software UART pins which is RC0 and RC1. But you can give it a try. No modification on the programming is needed in this case.



ok understood. thanks :)

Re: PR29 Modification ? HELP

PostPosted: Thu Nov 25, 2010 1:40 am
by Noobie
case ACK_ACCESS: LEDY=1;
if(data0!=0xFF)
{
lcd_goto(0);
send_string("Hello User ");
lcd_goto(11);
send_char(0x30 + data0);
lcd_goto(20);
send_string("Welcome");
error=0;
}


This is part of the original source code, with this it will appear at my LCD something like
" Hello User 1
Welcome"

if i want to modify the code so that my LCD will display the person name instead of User 1 how should i change the code?
lets say User 1= Sam; User 2= Max; User 3 = Ron; User 4 = King; User 5= Pete
(as by default PR29 can store 5 users)



what does this 0x30 means?

can i put something like




if (0x30 + data0 == 1)
{
lcd_goto(20);
send_string("Welcome Sam");
}
else if (0x30 + data0 == 2)
{
lcd_goto(20);
send_string("Welcome Max");
}
else if (0x30 + data0 == 3)
{
lcd_goto(20);
send_string("Welcome Ron")
}
else .........................

Re: PR29 Modification ? HELP

PostPosted: Thu Nov 25, 2010 8:06 am
by shahrul
You comparing 10 digit id and change into username

eg:
CODE: SELECT_ALL_CODE
char id1[]={"1234567890"},id2[]={"9876543210"};
         
j=0;
for(i=0;i<=9;i++){
     if(rfid[i]==id1[i]) j++;}   
//if all 10 digit rfid equal to 10 digit id1, j will equal to 10
if(j==10) user=1;

j=0;
for(i=0;i<=9;i++){
     if(rfid[i]==id2[i]) j++;}   
//if all 10 digit rfid equal to 10 digit id1, j will equal to 10
if(j==10) user=2;

lcd_goto(20);
send_string("Welcome ");
switch(user){
case 1: {send_string("Sam");break;}
case 2: {send_string("Max");break;}
default: {send_string("Alien");break;}
}

Re: PR29 Modification ? HELP

PostPosted: Thu Nov 25, 2010 5:11 pm
by Noobie
shahrul WROTE:You comparing 10 digit id and change into username

eg:
CODE: SELECT_ALL_CODE
char id1[]={"1234567890"},id2[]={"9876543210"};
         
j=0;
for(i=0;i<=9;i++){
     if(rfid[i]==id1[i]) j++;}   
//if all 10 digit rfid equal to 10 digit id1, j will equal to 10
if(j==10) user=1;

j=0;
for(i=0;i<=9;i++){
     if(rfid[i]==id2[i]) j++;}   
//if all 10 digit rfid equal to 10 digit id1, j will equal to 10
if(j==10) user=2;

lcd_goto(20);
send_string("Welcome ");
switch(user){
case 1: {send_string("Sam");break;}
case 2: {send_string("Max");break;}
default: {send_string("Alien");break;}
}


ty bro for the example. I'll try 1st.

but when i want to export the attendance to PC using the provided GUI. how to change it to display name also? instead of just user 1, user 2, ...?