Serial Int Question [modified]
-
Hi, you're welcome. It is a common mistake to think that anything called "serial interface" would fit the serial port of a PC, which implements just one kind of serial interface (technically it is an RS232C). The Wikipedia article describes the interface of your coin acceptor (that is barring possible historical evolution in I2C itself). :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
Now it's down to finding a cheap USB 2 I2C convertor, the sucking the out the data. I suppose want I attempt is replacing the function of the Credit Control Board. The way I see it the Coin Validator is a dumb (black) box that sends out signals when a coin is placed into it. The Credit Control Board works out the coinage and totals and spits outs credits accordingly. So without a Credit Control Board, I left to hook up my own. All very interesting stuff when you get into the finer details :)
Roger Irrelevant "he's completely hatstand"
-
Now it's down to finding a cheap USB 2 I2C convertor, the sucking the out the data. I suppose want I attempt is replacing the function of the Credit Control Board. The way I see it the Coin Validator is a dumb (black) box that sends out signals when a coin is placed into it. The Credit Control Board works out the coinage and totals and spits outs credits accordingly. So without a Credit Control Board, I left to hook up my own. All very interesting stuff when you get into the finer details :)
Roger Irrelevant "he's completely hatstand"
Hi, if you are in to both electronics and microcontroller software, then the easiest way would be to buy some prototype or demo board for a microcontroller having an on-board serial port (RS232C!) and four or more programmable I/O pins (or a real I2C, but that is not really necessary since you can dedicate the entire microcontroller to watching those two input pins). There are lots of those around, most of them cheap, and their development tools most often are free. Connecting the coin thing to it, and adding some embedded software would be al that is required to get a real PC peripheral; pretty soon after that PC's with RS232C will become obsolete, and you will need a USB-to-RS232C cable, but these currently are rather cheap. If your idea of software development is strictly PC-based, and you are unfamiliar with embedded systems, it would be a challenge to get things working without having the observability and debugging tools you have in say Visual Studio... The choice is yours. Good luck!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
Hi, if you are in to both electronics and microcontroller software, then the easiest way would be to buy some prototype or demo board for a microcontroller having an on-board serial port (RS232C!) and four or more programmable I/O pins (or a real I2C, but that is not really necessary since you can dedicate the entire microcontroller to watching those two input pins). There are lots of those around, most of them cheap, and their development tools most often are free. Connecting the coin thing to it, and adding some embedded software would be al that is required to get a real PC peripheral; pretty soon after that PC's with RS232C will become obsolete, and you will need a USB-to-RS232C cable, but these currently are rather cheap. If your idea of software development is strictly PC-based, and you are unfamiliar with embedded systems, it would be a challenge to get things working without having the observability and debugging tools you have in say Visual Studio... The choice is yours. Good luck!
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
Luc Pattyn wrote:
If your idea of software development is strictly PC-based, and you are unfamiliar with embedded systems, it would be a challenge to get things working without having the observability and debugging tools you have in say Visual Studio...
It is but I have used assembly in the past (wrote software for operating system many moons back), I'm not scared of a challange. The idea of a broad with programmable pins sound good, I'm I write in saying the software to program the chip is PICBASIC? Can you provide a link with an example of a board which would 'do' the job. Again Luc thanks for all your time you taken to answer questions. :beer:
Roger Irrelevant "he's completely hatstand"
-
Luc Pattyn wrote:
If your idea of software development is strictly PC-based, and you are unfamiliar with embedded systems, it would be a challenge to get things working without having the observability and debugging tools you have in say Visual Studio...
It is but I have used assembly in the past (wrote software for operating system many moons back), I'm not scared of a challange. The idea of a broad with programmable pins sound good, I'm I write in saying the software to program the chip is PICBASIC? Can you provide a link with an example of a board which would 'do' the job. Again Luc thanks for all your time you taken to answer questions. :beer:
Roger Irrelevant "he's completely hatstand"
Hi, I am not up-to-date on what is available from whom in this area, Microchip sure would be a candidate. You have to be careful about choice of programming language; I would be inclined to go with either assembly or C (or a subset, an embedded C, whatever they call it). PICBASIC might be an interpreted thing, and as such I can not judge it's speed without investiogating it. It would be disappointing if they made it very powerful and somewhat slow, so much so that it no longer can watch a few I/O pins, I don't know. If you feel up to it, go for it; if you think you made your final choice and want my opinion on it, you'll know how to reach me. :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
Ali found this; http://en.wikipedia.org/wiki/I%C2%B2C[^], look at bottom of page for links to USB 2 I2C products. BTW, names Norm not Roger :)
Roger Irrelevant "he's completely hatstand"
norm .net wrote:
BTW, names Norm not Roger
:-O:-O:-O:-O Just looked down at the bottom of your post, in a hurry, saw Roger and typed it! :-O:-O:-O:-O Soz So Peter, I read the other part of the thread and it looks like you have discovered it is I2C which is a good move forward. I would do it with a micro myself Stanley - its sounds like you are leaning that way, give it a go, micros are fun Joe! Have a great weekend Colin, :-D Regards,
Ali
-
norm .net wrote:
BTW, names Norm not Roger
:-O:-O:-O:-O Just looked down at the bottom of your post, in a hurry, saw Roger and typed it! :-O:-O:-O:-O Soz So Peter, I read the other part of the thread and it looks like you have discovered it is I2C which is a good move forward. I would do it with a micro myself Stanley - its sounds like you are leaning that way, give it a go, micros are fun Joe! Have a great weekend Colin, :-D Regards,
Ali
Thanks Margret ;)
Roger Irrelevant "he's completely hatstand"
-
Thanks Margret ;)
Roger Irrelevant "he's completely hatstand"
:laugh:
Ali
-
I have a serial interface on a device with 6 pins: 1 NC 2 0v 3 +12v 4 SClk 5 SData 6 0v Now I want to wire this to a serial Port on a PC, I have wired the 12v and 0v to a molex, but I need to work out were to wire SClk and SData, I'm guessing (on previous experience) that I should be wiring SClk to DTR and SDATA to RX on the RS232. I'm I warm or completely cold. BTW: The 12v and 0v and input supply voltages. -- modified at 9:02 Thursday 9th August, 2007 -- modified at 9:07 Thursday 9th August, 2007
Roger Irrelevant "he's completely hatstand"
Just reading this thread it appears that you want to interface to an I2C device. For simply writing to the device, it is pretty easy to do this using the PC parallel port. I have intefaces to many ICs that use this interface in this manner. It is even easier if you have an old PC running Win98, as there you could simply write to the parallel port using an OUT instruction. On OSs based on NT (i.e. Win2k and XP), you need a device driver. To give you an idea, here is a code snippet synchronously clocking n bits of data out of hte parallel port on a Win98 machine:
const int PORT = 0x378; // base address of LPT1 on
const char ENABLE = 1; // syn enable PC Pin # 2
const char CLOCK = 2; // syn clock PC Pin # 3
const char DATA = 4; // syn data PC Pin # 4char state;
void OutputP(long data, int n, bool bSync)
{
// take enable low
state &= ~ENABLE;outp(PORT, state);
long current_bit = pow(2,n-1);
for (int i = 0 ; i < n ; i++)
{
// set data bit
if (data & current_bit)
state |= DATA;
else
state &= ~DATA;
// output data bit
outp(PORT, state);// clock it state |= CLOCK; outp(PORT, state); state &= ~CLOCK; outp(PORT, state); current\_bit /= 2; }
// take enable high
state = ENABLE; // ensures all other lines are low
if (bSync)
state |= SYNC;
outp(PORT, state);
}depending on the speed of your PC you may need some delays to slow down the clocking.
Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
-
Thanks Margret ;)
Roger Irrelevant "he's completely hatstand"
Hi Norm, I came across this today and as they say "I thought of you", its an I2C USB Interface! I bet not many women have said that to you! :-D http://www.elektor.com/default.lynkx?pointer=1-28-16120-16357-16368-26623 Anyway, I had to pass it on in case it might be handy ..... Cheers,
Ali
-
Hi Norm, I came across this today and as they say "I thought of you", its an I2C USB Interface! I bet not many women have said that to you! :-D http://www.elektor.com/default.lynkx?pointer=1-28-16120-16357-16368-26623 Anyway, I had to pass it on in case it might be handy ..... Cheers,
Ali
Alison Pentland wrote:
I came across this today and as they say "I thought of you", its an I2C USB Interface! I bet not many women have said that to you!
Oh you're just one of millions ;) Had a look: articles date around 2004, there are newer ones, I'm just about buy a device under £20 USB->IC2, apparently these things are getting popular, whats needed is somebody to design a board and manufactor in China and bingo $$$. Sell for under £10 including an API:~ -> Norm <-
Roger Irrelevant "he's completely hatstand"