caramoan tour package

caramoan tour package

Author Topic: interfacing coin selector to PIC18F4620  (Read 198 times)

Offline poxkix

  • LR44 Battery
  • *
  • Posts: 2
  • Pogi/Ganda Points: 0
interfacing coin selector to PIC18F4620
« on: March 10, 2012, 06:28:51 PM »
The coin selector has no datasheet. So this is totally unknown to me.
It has 5 wires.
RED - 12v supply
BLACK - ground
GRAY (2) - counter +/-
WHITE - data/signal

My current logic:
The white wire will give a data/signal if a coin has been inserted.

This is the code in detecting the data/signal:
Code: [Select]
coin_count = 2;

while(coin_count > 0) {
                            while(PORTA.F0 != 1) {
                                 srand(seed++);
                            }

                                 if(PORTA.F0 == 1) {
                                      coin_count = coin_count - 1;
                                 }
                                      if(coin_count == 1) {
                                           Lcd_Custom_Out(3,13,"05");
                                      }
                       }

These are the things that I already tried to do:
1. connecting the WHITE wire directly to PORTA.F0, what happens the code executes even though there is no coin inserted.
2. I tried inverting the WHITE wire using the 7404, thinking that the WHITE wire gives a default data/signal of 1. It still gives the same result.
3. I tried using a transistor 2222A. Now, the code will not directly execute. If I insert a first coin, it executes but when the second is inserted nothing will happen. (the code should detect 2 coins inserted then it exits)

Philippine Electronics Forum

interfacing coin selector to PIC18F4620
« on: March 10, 2012, 06:28:51 PM »

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1890
  • Pogi/Ganda Points: 245
  • Gender: Male
  • Been at this longer than you've been alive.
Re: interfacing coin selector to PIC18F4620
« Reply #1 on: March 10, 2012, 06:36:47 PM »
Suntok sa buwan ang gagawin mo. Oscilloscope ang kailangan mo unless may makuhang datasheet.

Kung walang scope then let the PIC capture whats coming in at PORTA.F0, save it and transmit the waveform to  the LCD. You can use a timed interrupt to read the data at 5000-20000 samples/sec.
"Set your mind free!"

Philippine Electronics Forum

Re: interfacing coin selector to PIC18F4620
« Reply #1 on: March 10, 2012, 06:36:47 PM »

Offline poxkix

  • LR44 Battery
  • *
  • Posts: 2
  • Pogi/Ganda Points: 0
Re: interfacing coin selector to PIC18F4620
« Reply #2 on: March 10, 2012, 06:55:25 PM »
hindi poh bah digital 1 or 0 ang bigay nang white na wire sir?

Philippine Electronics Forum

Re: interfacing coin selector to PIC18F4620
« Reply #2 on: March 10, 2012, 06:55:25 PM »

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1890
  • Pogi/Ganda Points: 245
  • Gender: Male
  • Been at this longer than you've been alive.
Re: interfacing coin selector to PIC18F4620
« Reply #3 on: March 10, 2012, 09:49:02 PM »
hindi poh bah digital 1 or 0 ang bigay nang white na wire sir?

I don't know. You don't know. Connect it directly to the PIC and pwede masira ito.
"Set your mind free!"

Philippine Electronics Forum

Re: interfacing coin selector to PIC18F4620
« Reply #3 on: March 10, 2012, 09:49:02 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com