Discussion in "PIC Microcontroller Discussion" started by    Morris    Sep 19, 2009.
Fri Sep 25 2009, 01:49 pm
#11
1) the card reader get a RFID Card data (Function"Data_Receive" run right)
2) change RFID data to real Card Numbers (Function "Data_sever" run right)
at the same time ,the real Card Numbers saved in an array--- RS232_Buffer[15] (RS232_Buffer[15] run right or error?)
3) Send data of RS232_Buffer[15] to BUS (2 first bytes of RS232_Buffer[15] error!!!)

Manchester data in the card, and i have already gotten it rightly .

i don't know whether you understand my explanation as above or not?
Thanks, ExperimenterUK
Fri Sep 25 2009, 11:08 pm
#12


i don't know whether you understand my explanation as above or not?

Morris



Actually i don't
The trouble is I'm not really sure what you mean by EM4001.
Is it the way the data is stored on the card, or way the data is sent,
or even the device you are using.
Can you supply a definition ?.

As far as I can tell EM4001 defines the way the data is stored as a block of data
bits on the card.

The U2270B seems to output this block as a stream of bits not bytes.
As I see it there are no stop/starts bits so it is not an RS232 type serial link.
Can you tell us exactly what your hardware is and how it works ?.
Sat Sep 26 2009, 10:03 am
#13
Oh, My poor English! :blush
EM4001 data format as below to link
http://www.rfidtalk.com/showthread.php?t=832

The processing of reading & sending is as follwing
By the way,now i used pic12f629 instead of pic12c508
1) The GP5 port of MCU(PIC12F629) is for enabling U2270B
2) U2270B send a stream of bits to the GP4 port of MCU
3) MCU save the stream of bits to array(RFID_Buffer[16])
4) MCU process the data of RFID_Buffer[16] and get real card number
5) MCU save the card number to the appointed location of RS232_Buffer[15]
6) MCU send the data of RS232_Buffer[15] by the GP1 port TO a bus of RS232
Now the step 5 & 6 are error!!!
------------------------------------------------------------------
//sending a byte of RS232 is as following
bit WByte(uchar input)
{
uchar i=8;
T0IE = 1;
TXD = 0 ; //send the start bit of RS232 .the GP1 port defined at the first
WaitTF0(); //wait to finish the start bit
while(i--)
{
...
}
TXD = 1; //send the stop bit of RS232
WaitTF0(); //wait to finish the stop bit
T0IE = 0;
return TRUE;
}
------------------------------------------------------------------


[ Edited Sat Sep 26 2009, 10:10 am ]
Sat Sep 26 2009, 06:15 pm
#14
are you trying to do software uart??
is it of correct baud as your RFID reader?
Sat Sep 26 2009, 06:15 pm
#15
Sun Sep 27 2009, 12:30 am
#16
Software uart. and it is correct baud.
i wonder if you think it has some problem?
Sun Sep 27 2009, 01:27 am
#17


Oh, My poor English! :blush

5) MCU save the card number to the appointed location of RS232_Buffer[15]
6) MCU send the data of RS232_Buffer[15] by the GP1 port TO a bus of RS232
Now the step 5 & 6 are error!!!

Morris


Your English is fine, it's just that you know your project in great detail,
and the rest of us know nothing about it.
Now I understand a lot better

Have you tried putting test bytes into the into RS232_Buffer and seeing if they are sent
correctly.
Have you tried putting test data into the into RFID_Buffer and seeing if it is sent
correctly.


[ Edited Sun Sep 27 2009, 01:28 am ]
Sun Sep 27 2009, 11:39 am
#18
Thanks,ExpeimenterUK
I have already put the test data into RS232_Buffer but...
for example.Firstly, i defined RS232_Buffer[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
than putting 4 bytes into the 10th~13th location into RS232_Buffer.
Secondly, i send the RS232_Buffer to bus of RS232, but receive that the 2 first bytes of RS232_Buffer are always logic 0 number
I think that about 90% code maybe too large like what Ajab ever said.
How can i find out the error detail?
i don't know
Sun Sep 27 2009, 08:53 pm
#19
Am I right in thinking you problem is in sending the data out over a serial link ?
If so remove all the other code and just concentrate on getting your software
uart working.

Fill a buffer with text "ABCDEFGH" etc and send it to a PC running
Hyperterminal or similar.

Sun Sep 27 2009, 10:00 pm
#20
1)---- i skipped or removed all other code besides softwar uart.
-------i filled the buffer with text "ABCDEFGHIJKLMNO" .
-------i received the right text data "ABCDEFGHIJKLMNO".
-------i am sure i used hyperterminal!
2)---- i didn't skip or remove any code. than the first 2 bytes all became digital 0.
-------i am sure i used hyperterminal as well!

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

AntoniaRoons
Fri Apr 19 2024, 09:59 pm
carpinteyrowrl
Fri Apr 19 2024, 02:51 pm
DonaldJAX
Fri Apr 19 2024, 01:08 pm
Lewisuhakeply
Thu Apr 18 2024, 06:00 pm
Darrellciz
Thu Apr 18 2024, 11:07 am
Charlessber
Thu Apr 18 2024, 09:29 am
BartonSem
Thu Apr 18 2024, 04:56 am
DonaldKnown
Thu Apr 18 2024, 12:24 am