Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Non-USART Serial Interface

Status
Not open for further replies.

nodee

Junior Member level 3
Junior Member level 3
Joined
Jan 26, 2011
Messages
29
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,519
Hi all,

Im trying to implement a serial interface using a clock, Dout and Din on a PIC16F628A connecting to a HTRC110 RFID front end Ic, the HTRC has a non-usart type serial interface.

What is the best way to generate the clock for both devices? should i use the PWM on the PIC?

Can anyone point me in the direction of an example of how to create a serial interface of this or a similar type?

Thanks,
nodee
 

nodee,

Sincronous comunications drivers are reasonable easy to perform ( I assume you´re using C compiler ).
The clock is generated from master device ( microcontroler ), and data is aquired from slave acording the timing providen from master device.
Note that at this kind of comunication the baud rate doens´t need to mach an exact value, because clock transitions is what determines data progress.

Take a look here, wich can helps you :
https://www.edaboard.com/threads/24464/#post104821

+++
 

There really is no *best* way of generating the clock...it depends on the application. Using the PWM is definitely the easiest to setup, which makes it great for controlling motors, but it's harder to control if you're reading in data while clocking. It might be best to write a software routine for this.
 

PWM is great for clock generating but dor SPI communication(as nodee needs) is not necessary. It can be done by SW very easy. SPI communication accept wide rande of clock frequencies.
 

Ive managed to do it using the PWM 50% duty at about 2.5kHz. It works by waiting for the PWM timer to overflow (each rising edge) then setting another timer to count to 3/4 of the PWM period and the change output to the next data bit. works quite well, as I can turn the PWM on and off easily as and when I need to transmit.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top