Parallel circuit question
Discussion in "Hardware" started by helloleong Jul 28, 2010.
Wed Jul 28 2010, 03:12 pm
I got a circuit problem to ask.
Here is the circuit diagram
The question i wanna ask is when the PIC send a 0v and at the same time EM module send 5V, what signal will the controller detect?
This circuit is done by the previous trainee engineering.
The PIC is the reader to detect button press and read card.
So the EM module is use to read card. When no card was read D0 and D1 always stay high (5V). When card present it will send out 0 pulse.
So i had set the pic 2 pin to input to detect read card
And set to output when button press, if the button press signal finish send to the controller it will set back to input to detect card.
It still works, but some times the controller cannot detect signal send.
And my boss said reader hang, and ask me why.
But just the controller no response, the reader still running as usual.
Thank you
Here is the circuit diagram
The question i wanna ask is when the PIC send a 0v and at the same time EM module send 5V, what signal will the controller detect?
This circuit is done by the previous trainee engineering.
The PIC is the reader to detect button press and read card.
So the EM module is use to read card. When no card was read D0 and D1 always stay high (5V). When card present it will send out 0 pulse.
So i had set the pic 2 pin to input to detect read card
And set to output when button press, if the button press signal finish send to the controller it will set back to input to detect card.
It still works, but some times the controller cannot detect signal send.
And my boss said reader hang, and ask me why.
But just the controller no response, the reader still running as usual.
Thank you
Wed Jul 28 2010, 04:50 pm
The question i wanna ask is when the PIC send a 0v and at the same time EM module send 5V, what signal will the controller detect?
other controller will get 0, as complete circuit current is sink inside the PIC who is sending 0.
One question to you..
Do you understand weigand protocol?
the reason for asking question is that you cannot set D0 or D1 to be o/p pins they are always input to controller side and o/p on reader side. so controller is always in reading mode. as soon as card is detected on reader, it will send data in weigand format.
usually two interrupt pins are used to read weigand modules, programmer just have to shift in 0 or 1 depending on which input goes low. if D0 goes low means reader is sending a 0, if D1 goes low means reader is sending 1.
I suggest you to read wikipedia for more information on weigand format. also refer datasheet of reader module you're using.
helloleong like this.
Thu Jul 29 2010, 06:48 am
Thanks for your reply . I still have a question to ask. as a complete circuit will the current sink in to the another micro-controller too?(Except PIC that you said)
This PCB is done by the previous trainee. I think the reason she did like this is because the PIC no need detect the card wiegand and always set as output to send out the button wiegand to the controller.
So when i take over the project my boss say she want indication when card read. So i have to always set the D0 and D1 input (Port B interrupt) and output (send out button wiegand).
I know the PIC should always sets as input. But they already make the PCB like this, and i had tell my boss this problem (She seems like half believe only, and said is the reader hang, ask me add watchdog to the software) so they are changing another version of PCB to make the D0 and D1 not to be parallel.
So now the reader software change to output only to send out the button wiegand and let the em module send out card wiegand it self(Like the previous trainee does). Hope its no problem happen.
This PCB is done by the previous trainee. I think the reason she did like this is because the PIC no need detect the card wiegand and always set as output to send out the button wiegand to the controller.
So when i take over the project my boss say she want indication when card read. So i have to always set the D0 and D1 input (Port B interrupt) and output (send out button wiegand).
I know the PIC should always sets as input. But they already make the PCB like this, and i had tell my boss this problem (She seems like half believe only, and said is the reader hang, ask me add watchdog to the software) so they are changing another version of PCB to make the D0 and D1 not to be parallel.
So now the reader software change to output only to send out the button wiegand and let the em module send out card wiegand it self(Like the previous trainee does). Hope its no problem happen.
Thu Jul 29 2010, 10:44 pm
I am really not sure what is point of misunderstanding in your company.
I am confused with few things.. are you trying to tap weigand o/p of reader?
what is button wiegand? i dont understand it.
tell you truth i dont understand whats you exactly trying to do.
all i can say is wiegand reader will act as o/p, pic and other controller act as i/p. so they always read and never write anything on wiegand data lines.
I am confused with few things.. are you trying to tap weigand o/p of reader?
I think the reason she did like this is because the PIC no need detect the card wiegand and always set as output to send out the button wiegand to the controller.
what is button wiegand? i dont understand it.
tell you truth i dont understand whats you exactly trying to do.
all i can say is wiegand reader will act as o/p, pic and other controller act as i/p. so they always read and never write anything on wiegand data lines.
helloleong like this.
Fri Jul 30 2010, 01:26 am
I share Ajay's confusion
but I think you are saying you have a card reader and a keypad.
You read the keypad with the PIC labled "reader", and want to send the
output of the PIC and EM module to the controller PIC over the Wiegand bus.
The problem is, it does not seem that the Wiegand bus can be shared !
you can only have one sender and one listener.
The best way to avoid transmission clashes is to have the EM module talk
to the "reader" PIC only.
The same PIC can get input from the keypad and send both inputs
out over the Wiegand bus to the controlling PIC.
but I think you are saying you have a card reader and a keypad.
You read the keypad with the PIC labled "reader", and want to send the
output of the PIC and EM module to the controller PIC over the Wiegand bus.
The problem is, it does not seem that the Wiegand bus can be shared !
you can only have one sender and one listener.
The best way to avoid transmission clashes is to have the EM module talk
to the "reader" PIC only.
The same PIC can get input from the keypad and send both inputs
out over the Wiegand bus to the controlling PIC.
helloleong like this.
Fri Jul 30 2010, 08:28 am
At first i also confuse like you all. ExperimenterUK was right.
What the company want is a product with 2 version of software. One is a reader another is a standalone controller.
Reader: Only send out button data and card data to another controller unit
Standalone Controller: Process the button data and card data it self to check whether password correct & etc.
So the question i ask earlier is the reader software. (The controller software i set it as input only has no problem)
And i think the hardware unit should goes like this
But the current board hardware goes like this (although they are changing the to a new PCB, but they still testing on this current board unit.)
So the previous software version i did the wiegand bus line as input and output. But most of the time it works fine, just some of the time the controller fail to detect data send.
(The pic detect card just to show card readed indication and did not process the data, because at the same time the card data is parallel sending to the another controller unit to process it self.
So i change back to another software just set wiegand bus line as output to the controller and let the card wiegand send data it self without pic process.
But i have a question about the current flow for this circuit
Question: When the reader unit power on and did not send out any data, then the card generator send out card wiegand, but the other controller cannot detect any thing. Only after the button data(eg. 1=0x0001) send out to the controller, then the following card data only can be detect by the controller. Anybody know hows the current flow?
Thank you very much.
What the company want is a product with 2 version of software. One is a reader another is a standalone controller.
Reader: Only send out button data and card data to another controller unit
Standalone Controller: Process the button data and card data it self to check whether password correct & etc.
So the question i ask earlier is the reader software. (The controller software i set it as input only has no problem)
And i think the hardware unit should goes like this
But the current board hardware goes like this (although they are changing the to a new PCB, but they still testing on this current board unit.)
So the previous software version i did the wiegand bus line as input and output. But most of the time it works fine, just some of the time the controller fail to detect data send.
(The pic detect card just to show card readed indication and did not process the data, because at the same time the card data is parallel sending to the another controller unit to process it self.
So i change back to another software just set wiegand bus line as output to the controller and let the card wiegand send data it self without pic process.
But i have a question about the current flow for this circuit
Question: When the reader unit power on and did not send out any data, then the card generator send out card wiegand, but the other controller cannot detect any thing. Only after the button data(eg. 1=0x0001) send out to the controller, then the following card data only can be detect by the controller. Anybody know hows the current flow?
Thank you very much.
[ Edited Fri Jul 30 2010, 08:36 am ]
Sun Aug 01 2010, 01:29 am
well in short.. you cannot get card data and keypad data sent over common weigand line.. your data will clash for sure incase both are transmitting at that moment. incase only one is transmitting i believe then it wont be a problem, but still cant say coz depends on other circuit connected on those weigand lines. logical connections may create problem..
PIC and controller unit outside should have direct connectivity like you have shown in first pic "Proper Circuit"
you can use any other serial interface like SPI/UART to do so.
In PIC Software V2, when any of controller/reader makes data line low, you will read low on the controller end. but incase both are transmitting it is possible that both lines goes low at same time as one is transmitting 1 and other 0 so clashes are still possible. consider the communication approach i suggested above.
PIC and controller unit outside should have direct connectivity like you have shown in first pic "Proper Circuit"
you can use any other serial interface like SPI/UART to do so.
In PIC Software V2, when any of controller/reader makes data line low, you will read low on the controller end. but incase both are transmitting it is possible that both lines goes low at same time as one is transmitting 1 and other 0 so clashes are still possible. consider the communication approach i suggested above.
helloleong like this.
Powered by e107 Forum System