> > Yes, that's exactly what I tried today. One can output a signal on > certain pins by hardware, without it generatig a software interrupt, > but I didn't have any success yet, same results.
Only rare CPUs allows that mode, one of them is the PIC 18F2620. > > I think the problem lies on the output signal and the interrupt (the > one which samples the i/o line not being in synch). > > Hence why the need for a clock, one setups usart and recieves just > what the card sends (the transciever does handle start and stop bits, > etc). > > Not sure yet how to synch with the external clock with usart either, No sync is needed. Just a speed relationship. The USART will detect the start bit and sync with that provided the baud rate is OK. > but I'm pretty sure that by going the usart way, the stop bits needed > when one wants the card to repeat las byte are not going to be easily > accessible, but we'll see. I'm definitely sure you can use the usart. It's half duplex, so you just have to short Tx and Rx and disable receiver when transmitting (and that may not be needed). The fundamental part is to set the correct baud rate. The USART bit rate must be 1/372 the frequency present on the card "clock" pin. Forget about PPS until it works at basic speed. If you can use the same clock frequency for the usart and the clock output, you're done. Just set the baud rate timer to 372 and exchange bytes. If you know that the input to the baud rate generator is a fraction of the xtal clock (because of a prescaler, for example), then use the XTALOUT signal from your cpu to clock the card and compute the proper baud rate generator parameters so that the usart bit rate is 1/372 the XTAL clock :) Then remember cards can not use a very high clock: 3-5 MHz will be ok. This will also be you CPU's clock. Also, I don't know your microcontroller, but some of them can use an external clock to generate baud rates. Sebastien _______________________________________________ Muscle mailing list [email protected] http://lists.drizzle.com/mailman/listinfo/muscle
