I've just been trying a 16F18326 in the place of a 16F1705. The HI2C is not working.
I've tried incorporating the difference PPS setting but no luck.
Can anybody spot any mistakes here.
#chip 16F18326,4
#config RSTOSC=HFINT1, MCLRE=Off, WDT=off, boren=off
SET PPSLOCK.0 OFF 'UNLOCK PPS
RC0PPS=B'00011000' 'C.0=CLK
RC1PPS=B'00011001' 'C.1=DAT
SSP1DATPPS=B'00010001' 'DAT TO C.1
SSP1CLKPPS=B'00010000' 'CLK TO C.0
SET PPSLOCK.0 ON 'LOCK PPS
#define hi2c_BAUD_RATE 400
#define hi2c_DATA PORTC.1
#define hi2c_CLOCK PORTC.0
Dir hi2c_DATA in
Dir hi2c_CLOCK in
hi2cMode Master
Last edit: David Stephenson 2016-10-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've just been trying a 16F18326 in the place of a 16F1705. The HI2C is not working.
I've tried incorporating the difference PPS setting but no luck.
Can anybody spot any mistakes here.
Last edit: David Stephenson 2016-10-18
Look at all the demos. Examples are there and play safe use hex not binary for the assignments.
see here, https://sourceforge.net/projects/gcbasic/files/Demonstration%20Files/Vendor%20Boards/Great%20Cow%20Basic%20Demo%20Board/16f18326%20ChipRange%20Demonstrations/
This will work. But, this looks the same as yours. However, try using the UNLOCKPPS and LOCKPPS
The demos 16f18326 work - so, review these in detail.
Still can't get it to work. Is my #config correct?
Try commenting out the #config line. I'm using
'#config MCLRE_ON, OSC=HFINT32, FEXTOSC_OFF
on the 16F18313 and that seems to work.If you run at 32Mhz instead of 4Mhz does that change anything?
Last edit: Peter 2016-10-19
Take the demo code as a baseline. I know that works it has been tested.
I do not have a 16F18326, but I do have several 16F18855 chips.
So far I cannot get Hardware I2C to work at all on the 16F18855 with a known good 4x20 LCD Module. Using unmodified demo code.
Software I2C works fine on same chip with same LCD Module on same I/0 pins. (RC3/RC4)
Will investigate further ....
(Using Compiler RC3)
Bill
Here the results I have just completed.
Give me a few hours. I can see the issue already - I have the Logic Analyser hooked up and I just need an hour to fix the code.
We tested HwI2c2 but i did not know the HwI2c was not working. :-(
Last edit: Anobium 2016-10-21
Update. Fixedin v.0.95.010 rc6.
I have attached LCD demonstration code for a 16f18326. This is now operating as expected.
Last edit: Anobium 2016-10-21