Hello,
I try to communicate with a DS1307 and a SAA1064 via the I2C of a 16f887 (RC3 & RC4 used with pull-ups).
I checked with my scope but I have no output... I switched over to a 18F4455 and then it works !
So I came back to the 16F887 and tested the RC0-7 ports with just led's and it was ok.
I attached my test program, did I make a mistake or does the I2c component has problem with this pic ?
Thanks,
Bernard
Enabling I2C component on a 16F887 [Solved]
Moderator: Benj
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Enabling I2C component on a 16F887 [Solved]
- Attachments
-
- Test SAA1064.fcf
- (5.5 KiB) Downloaded 285 times
Last edited by Crenwick on Mon Oct 24, 2011 3:54 pm, edited 2 times in total.
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Re: Enabling I2C component on a 16F887
Hello all,
Can someone please test the program above and check if signals are ok on RC3/4 ?
I passed a lot of houres without any results
Thanks
Bernard
Can someone please test the program above and check if signals are ok on RC3/4 ?
I passed a lot of houres without any results
Thanks
Bernard
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Enabling I2C component on a 16F887
Hello Bernard,
Sorry for the delay. I have tested your program on a 16F887 device here and the problem seems to be related to programming rather then related to the Flowcode program. I programmed using a PICkit and the program is running correctly. I will see if I can work out what is wrong with the PPP programming software regarding this device and let you know.
Sorry for the delay. I have tested your program on a 16F887 device here and the problem seems to be related to programming rather then related to the Flowcode program. I programmed using a PICkit and the program is running correctly. I will see if I can work out what is wrong with the PPP programming software regarding this device and let you know.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Enabling I2C component on a 16F887
Seems to get the device working correctly from PPP or from Flowcode using the EB006 programmer you will need to reset the device after it has been programmed. This seems to allow it to run correctly with I2C.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Re: Enabling I2C component on a 16F887
Thanks ben for looking at my problem,
I am also using the EB006 V07 but unfortunately the program did not run...
What do you mean with "reset" is it just do a MCLR reset with the push button ?
Thaks for the help,
Bernard
I am also using the EB006 V07 but unfortunately the program did not run...
What do you mean with "reset" is it just do a MCLR reset with the push button ?
Thaks for the help,
Bernard
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Enabling I2C component on a 16F887
Hello Bernard,
Yes just pressing the reset button on the EB006 after a program cycle seems to get my device working. Are you getting any error messages or any warnings during the programming portion of the compile to chip process?
Yes just pressing the reset button on the EB006 after a program cycle seems to get my device working. Are you getting any error messages or any warnings during the programming portion of the compile to chip process?
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Re: Enabling I2C component on a 16F887
When I press reset the only thing I see on my scope is SDA that goes done for 850us and not after each reset.
I checked the log, in the C compile no errors just warnings in assembler part (see copy)
Test SAA1064.c success
success
Return code = 0
Launching the linker/assembler...
c:\program files (x86)\matrix multimedia\flowcode v4\boostc\boostlink_pic.exe -ld "C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\BoostC\lib" libc.pic16.lib flowcode.pic16.lib rand.pic16.lib float.pic16.lib "Test SAA1064.obj" -t PIC16F887 -d "S:\Documents de Bernard\Fichier Flowcode\RTC" -p "Test SAA1064"
BoostLink Optimizing Linker Version 7.03
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 David Hobday
Caution: Delay inaccurrate: 'delay_ms', Delay overhead:0ms, Unit delay:1.00016ms, Delay resolution:1 units
Warning unreferenced functions removed:
FCI_FLOAT_TO_STRING in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_NUMBER_TO_HEX in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_STRING_TO_INT in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_STRING_TO_FLOAT in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
Wdt_Delay_S in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
Wdt_Delay_Ms in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
isinf in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCD_I2C_Master0_MI2C_Restart in: S:\Documents de Bernard\Fichier Flowcode\RTC\Test SAA1064.c
FCD_I2C_Master0_MI2C_Receive_Byte in: S:\Documents de Bernard\Fichier Flowcode\RTC\Test SAA1064.c
FCD_I2C_Master0_MI2C_Send_Byte_Transaction in: S:\Documents de Bernard\Fichier Flowcode\RTC\Test SAA1064.c
FCD_I2C_Master0_MI2C_Receive_Byte_Transaction in: S:\Documents de Bernard\Fichier Flowcode\RTC\Test SAA1064.c
I checked the log, in the C compile no errors just warnings in assembler part (see copy)
Test SAA1064.c success
success
Return code = 0
Launching the linker/assembler...
c:\program files (x86)\matrix multimedia\flowcode v4\boostc\boostlink_pic.exe -ld "C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\BoostC\lib" libc.pic16.lib flowcode.pic16.lib rand.pic16.lib float.pic16.lib "Test SAA1064.obj" -t PIC16F887 -d "S:\Documents de Bernard\Fichier Flowcode\RTC" -p "Test SAA1064"
BoostLink Optimizing Linker Version 7.03
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 David Hobday
Caution: Delay inaccurrate: 'delay_ms', Delay overhead:0ms, Unit delay:1.00016ms, Delay resolution:1 units
Warning unreferenced functions removed:
FCI_FLOAT_TO_STRING in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_NUMBER_TO_HEX in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_STRING_TO_INT in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCI_STRING_TO_FLOAT in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
Wdt_Delay_S in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
Wdt_Delay_Ms in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
isinf in: C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\FCD\internals.h
FCD_I2C_Master0_MI2C_Restart in: S:\Documents de Bernard\Fichier Flowcode\RTC\Test SAA1064.c
FCD_I2C_Master0_MI2C_Receive_Byte in: S:\Documents de Bernard\Fichier Flowcode\RTC\Test SAA1064.c
FCD_I2C_Master0_MI2C_Send_Byte_Transaction in: S:\Documents de Bernard\Fichier Flowcode\RTC\Test SAA1064.c
FCD_I2C_Master0_MI2C_Receive_Byte_Transaction in: S:\Documents de Bernard\Fichier Flowcode\RTC\Test SAA1064.c
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Re: Enabling I2C component on a 16F887
And here is the same program but with a 18F4455 (crazy)
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Re: Enabling I2C component on a 16F887
Problem solved !
I had also a DS1307 in circuit and it seems to be a bad one ...
But I can't explain why it worked with the 18f4455
I'm happy, now I can go further
Thanks
I had also a DS1307 in circuit and it seems to be a bad one ...
But I can't explain why it worked with the 18f4455
I'm happy, now I can go further
Thanks
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Enabling I2C component on a 16F887 [Solved]
Brilliant, glad you got it working correctly.
Thanks for letting us know.
Thanks for letting us know.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel