PR29 Modification ? HELP

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

PR29 Modification ? HELP

Postby Noobie » Mon Nov 08, 2010 6:19 pm

How to modify the product schematic to interface with PC using serial port DB9 instead of passing through UART then UC00A?
User avatar
Noobie
Freshie
 
Posts: 7
Joined: Mon Nov 08, 2010 5:56 pm

Re: PR29 Modification ?

Postby shahrul » Mon Nov 08, 2010 8:41 pm

If you are using UART-to-USB converter, it's operate with UART, so you can connect directly to pin RC6 and RC7.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PR29 Modification ?

Postby ober » Mon Nov 08, 2010 9:46 pm

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.
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm


Re: PR29 Modification ? HELP

Postby hyng » Mon Nov 08, 2010 10:56 pm

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.
User avatar
hyng
Moderator
 
Posts: 292
Joined: Thu Apr 16, 2009 11:35 am

Re: PR29 Modification ?

Postby shahrul » Mon Nov 08, 2010 11:15 pm

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.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PR29 Modification ? HELP

Postby Noobie » Mon Nov 08, 2010 11:52 pm

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 :)
User avatar
Noobie
Freshie
 
Posts: 7
Joined: Mon Nov 08, 2010 5:56 pm

Re: PR29 Modification ? HELP

Postby Noobie » Thu Nov 25, 2010 1:40 am

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 .........................
User avatar
Noobie
Freshie
 
Posts: 7
Joined: Mon Nov 08, 2010 5:56 pm

Re: PR29 Modification ? HELP

Postby shahrul » Thu Nov 25, 2010 8:06 am

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;}
}
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PR29 Modification ? HELP

Postby Noobie » Thu Nov 25, 2010 5:11 pm

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, ...?
User avatar
Noobie
Freshie
 
Posts: 7
Joined: Mon Nov 08, 2010 5:56 pm

Next

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 2 guests

cron