PDA

View Full Version : I2C, little help please



gluphus
- 14th March 2006, 06:12
Has anyone got the code from

http://www.warburtech.com/compilers/picbasic.pro/sample.code.htm, the standard i2cslave.bas and i2cmaster.bas to work on the 16G6XX?

My compiling gets stuck in "assembling..."
I bet it has something to do with the regisiters, ie: around here:

' Define used register flags
SSPIF VAR PIR1.3 ' SSP (I2C) interrupt flag
BF VAR SSPSTAT.0 ' SSP (I2C) Buffer Full
R_W VAR SSPSTAT.2 ' SSP (I2C) Read/Write
D_A VAR SSPSTAT.5 ' SSP (I2C) Data/Address
CKP VAR SSPCON.4 ' SSP (I2C) SCK Release Control
SSPEN VAR SSPCON.5 ' SSP (I2C) Enable
SSPOV VAR SSPCON.6 ' SSP (I2C) Receive Overflow Indicator
WCOL VAR SSPCON.7 ' SSP (I2C) Write Collision Detect

but I am still getting used to the i2c.

If anyone has any thoughts, experiences, etc... about this, I would appreciate them.

mister_e
- 14th March 2006, 21:34
PIC# please!

Are you sure the PIC you use have those registers?

What about your whole code?

gluphus
- 15th March 2006, 05:32
Yup. That was it. I was missreading the PIC16 -vs- PIC18...
apples to apples and all that...

Now I am on to the fun part of I2C'ing between PBP and Microchip C18 chips...

Thanks for the crosscheck!