![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Well offcourse it should be possible. I have only one Line / Pin. It Should be 2 way communication. With out an clockline.... anyone ideas how to do the job?? One side is 4Mhz the other side is 20Mhz. Speed isn't important. Is it true that i just can hook up the pins to each other?? I'm debugging the 2 pics with both one debug pin connected to the comport of my pc... but the problem i have is that how do i switch from sending to recieving on one pin.. because the other side will see this as one bit/byte not?? Tks | |
| |
| | (permalink) |
| Manchester or "1 wire"
__________________ Il give you shocking experience. | |
| |
| | (permalink) |
| All you need is simple serial comms, simply connect the pins together and connect them to a pull-up resistor. Set both pins as inputs, the pull-up resistor will cause them both to read HIGH. In order to send data make one PIC an output, and set the pin LOW, this is the start bit for the serial comms - carry on as normal sending the byte just like RS232, ending with a stop bit (setting the pin HIGH again, then TRIS'ing back to an input). The receiving side simply waits until it gets a start bit, then does the normal serial receive routine. To transmit the other way, simply reverse the process!. There's no need for Manchester coding, it would provide no functionality whatsoever, and would slow things down. | |
| |
| | (permalink) |
| The true is nigel that i use an compiler, would the hardware requirements change?? I now don't use the pullup, and it works sometimes, but not always.. also many times one of the devies keep reading the pin..(waiting for data,) with as an result the other also start waiting because he just sended the data. Will try the pull up.. (4K res to 5volt rails) maybe i could do something witht he dallas 1 wire wich is also built in... but serial is already ready.. when i dont use the wait for char command also the devices keep seeing bytes etc.. sow maybe the pins are then floating arround???? Tks | |
| |
| | (permalink) |
| If you're using a high level compiler you're severely restricting your options - I'm presuming you're trying to use the in-built comms routines?. However, there's nothing to stop you writing your own routines in C (assuming it's a C compiler you're using?). | |
| |
| | (permalink) |
| it works perfectly, its just this problem wich every time comes up! The crystal problem with the smartcard is now just like you said. The mod i did was, i now use as clock source the same chip. with a 4mhz external OSC. Sow the impedance and every other param are more the same.. and the chips will be exactly doing the same. TKs | |
| |
| | (permalink) | |
| Quote:
Why have you only got one pin available for the communication?, smartcards give at least three - MCLR, and the data and clock pins so that you can program it. | ||
| |
| | (permalink) |
| Have MCLR,Clock,Data pin.. (and VDD, VSS) Clock you will need to startup the device in that matter that it works..and processes your programm. MCLR you will need to put it high sow it starts processing to.(reset pin).. And Data Pin is then the only one wich is free available for communication / verication purposes.... Because of the fact that it would be very insecure to not make it 2way comm. You will need to switch input / ouput many times. The problem i had nigel was just the pullup resistor. Big Fault/ Big consequences the problem was that it worked a few times... But now its reliable. Tks | |
| |
| | (permalink) |
| You're missing a pin that has to be there!. Assuming it's a PIC on the smartcard?. To program the PIC it requires: Vdd Vss MCLR RB6 (programming clock) RB7 (programming data) For the smartcard to run a program it require: Vdd Vss MCLR Oscillator input (pin 16 on a 16x84) This gives a total of six connections to the PIC on the card, two of which (RB6 and RB7) are general purpose I/O pins. Are you perhaps confusing the programming clock input with the main oscillator input?. | |
| |
| | (permalink) |
| sorry to mention!!! but the RB6 is internally connected to the clock line. So while programming you use the clock line for the RB6 pin.. while normally use you just use clock.. sow only RB7 is there for the outside world. I was lucky that i had some PCB smartcards with the same pics sow i just made an serial debugpin on them.. etc.. Sow i could test with an unlimitted pic...and in real life i just use the wafer edition. | |
| |
| | (permalink) |
| Clock Source!! use same pic model for best performance.. | |
| |
| | (permalink) |
| | |
| |
| | (permalink) |
| I now have the situation that i have 2 lines available and i wanted to do the same trick. Sow i hooked u Rx with Tx and Tx with Rx this is correct i asume?? Is here also the need of the 4,7K pullups???? If sow wy not when using an MAX232??? Regards, Tks | |
| |
| | (permalink) | ||
| Quote:
Quote:
| |||
| |
| | (permalink) | |
| Quote:
Most C programmers do not use built-in compiler routines and do not recommend them. They are not versatile or portable and it's simply more direct to write to the registers in a way similar to assembly. The difficulty is in time-critical bit-banged routines; that is, those not using hardware modules and not timed by timer interrupts. The problem is still resolvable.
__________________ I thought what I'd do was I'd pretend I was one of those deaf-mutes. | ||
| |