Sync PIC16F684 output with FOSC/4 clock?

ErnieM

Joined Apr 24, 2011
8,415
The other chip is not an MCU of my programming, it's an HTRC11001T - an RFID reader/filter.

The communication protocol given in the datasheet sounds simple enough - "a three wire interface consisting of SCLK, data in, data out".
Three wires would be a Serial Peripheral Interface Bus.

PICs may have a MSSP module that works to this protocol. (The PIC16F684 is one of the few PIC16's that do NOT have this feature.)
 
Last edited:

takao21203

Joined Apr 28, 2012
3,702
Yes I2C is not too much dramatic.

I was thinking (reading the first posts) Op wanted to link two PIC or a PIC with another controller.

I2C is easy because I2C is already "waiting" for commands.

When you "talk" to a device MCU, you never know if it is ready, unless it has hardware serial port.
 

Thread Starter

Fordy

Joined Nov 29, 2011
15
Yes it is better to write:

Rich (BB code):
#define sclk PORTAbits.RA0
Thanks for this, but I'm still getting some errors.

Each time I use the name defined, I get an error (symbol not previously defined).

Any idea? Should it be in a separate file, with an #include? I wouldn't have thought that would matter.


On my config options from MPLAB X, I get:
Rich (BB code):
; PIC16F684 Configuration Bit Settings

#include "p16F684.inc"

; CONFIG
; __config 0xFCF4
 __CONFIG _CONFIG1, _FOSC_INTOSCIO & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _IESO_ON & _FCMEN_ON
But _CONFIG1 is "not previously defined" in error output, and the comma after it is an illegal character.


Thanks again.
 
Top