I have spent best part of the day fiddling around reconfigureing evertything back from working with TinBootloader and with PuTty but I still cannot make my 16F1937 give up its secretive I2C bus information.
I have everything setup the way you have in your video, Display and RTC on the 16F1937 I2C bus, Pk3 connected to the target device and i2cHardwareDiscovery to Terminal_Alternative_Display_16F1937.gcb programmed on the device - Nothing!
I'm not happy with some of the settings on PuTty but I would have expected something in the output pane.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Let us know how you resolved the issue... my first sentence, in my last posting, should be you a clue.
And, you may be even luckier... this chip supports SCKP... set SCKP =1 So, you dont need that TTL converter. :-)
SCKP: Synchronous Clock Polarity Select bit
Asynchronous mode:
1 = Transmit inverted data to the RB7/TX/CK pin
0 = Transmit non-inverted data to the RB7/TX/CK pin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Whilst you are at it have a look at your Putty settings and turn OFF the hand shaking.
In photo 3 it shows flow control as Xon/Xoff that should be set to None.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have now manged to combine all three devices 16F18326, DS1307 RTC and the SSD1307 GLCD using the ICSP TinyBootloader. with the fantastic help, encouragement and support from William Roth and Evan Venn - A very grateful thank you
attached is some scratch code for a Day, Date and time with leading 0’s on the Date and time. The project uses the TinyBootloader on Pins 12 and 13 (ICSPCLK & ICSPDAT)
I have advanced my project to incorporate some clock button inputs for time adjustments and hour counters for recording running hours etc. which I will publish when completed.
Thank you for your kind remarks Evan, Praise form the Gods – Wow!!
Being aware of the possible limits of the 16F18326 I want to incorporate an eeprom or an I2C NVR on the bus. One problem I am having is how do I write and read to a device on the bus rather than the eeprom on the 16F18326, what is the syntax to address such a beast?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As you already have a DS1307 why not use that for your NVR.
The DS1307, in adition to the RTC, also containes 56-Byte, Battery-Backed, General-Purpose
RAM with Unlimited Writes.
You just read and write it the same way as the other registers in the DS1307, no special code needed.
Cheers
Chris
Last edit: Chris Roper 2017-05-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry Keith, I have not used it in GCBASIC so I can't Help you there, but I
do know that the commands are included in the GCBASIC DS1307 so if you are
using the Library for your time functions you already have the NVM
Functions too. I suggest you look in the Header file or any documentation
you used to get the DS1307 working.
Cheers
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sub DS1307_Write(in DS_Addr, in DS_Value)
;Write to the internal RAM. Use addresses 0x08 to 0x3F only,
;else there will be wraparound to the register space of
;0x00 to 0x07. This is especially important when doing
;multibyte writes. But note that this subroutine could
;also be used to write to clock registers 0 though 7 if
;that's really what you want, for low level access.
and
sub DS1307_Read(in DS_Addr, out DS_Value)
;Read from the internal RAM. See the notes, above.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Keith mentioned earlier that he had one of those DS1307 I2C fleabay modules. That has a 32kbit, 4kbyte eeprom on board, if more data space is required. It has the same I2C address as other eeproms like the 24LC256. It also has a place to mount a DS18b20 temp sensor on there too if you want. Pullup resistor already in place, just hookup the 1-wire "DS" pin and it is ready to go.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Kent and thank you so much for your help. Yes, you are right I have not one but two of those DS1307 I2C modules, they are ideal for poking about and learning how things tick.
with. The eeprom I want to access is siting at 0xA0.
I really need to fully understand what makes these tick for when I come to the PCB design. I don't like cobbling things together Heath Robinson style.
I'm pleased I raised this issue, I was wondering what the three drillings with the TO92 outline was for on RTC module. This is going to come in really useful as my next project after this is a temperature alarm monitor for our two freezers.
I ordered and received one of the DS1307 Modules like Keith has. When I removed the device from the package the battery holder & battery fell fell right off of the board due to poor solder joints. Inspection showed more bad solder joints so I reflowed the whole board in a toster oven and them manually resoldered the battery holder back on. It needs to be noted that the batter is a reghargable LIR CR2032 and that putting a regular CR2032 battery on this board could lead to an explosion.
There seems to be no datasheet availabe for this cheap module and no explanation of the what the "DS" pin is for... or what the optional transistor is for. My guess is it for charging the battery but who knows?
After the repairs and adding header pins to the module, I2C discovery shows all three devices present. LCD module at 0x7E, DS1307 at 0XA0 and the (24C32) EEPROM Device at 0xA0.
The "ATMEL" 24C32 EEPROM can be used with the I2CEEPROM.h.library I (highly) modified one of the I2C EEPROM Demos for the PICI6F18346 and it seems to works OK. This EEPROM uses 32 byte page writes so that needs to be set properly in Source Code.
Attached is the modified Demo Program for the 24C32 EEprom using a 16F18346.
@Keith, change chip to 16F18326 & Change PPS/ I2C Pins as needed for your setup.
William, I follow all GCB topics whether I fully understand them or not. Please post the ebay link to the DS1307 I2C device you purchased. This will help me understand the thread more completely.
Thank you,
CJ
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I purchased from Amazon Prime so as not to wait for China Post and customs delays. I seldom purchase anything from Ebay anymore unless it is the ONLY source for a specific device.
Thanks for the link. Funny though. Nothing I've received from China has fallen off the board or had a cold or dry solder joint....and I get a lot of stuff from them. :-)
CJ
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Look at the Amazon reviews for this and others like the ones from SainsMart.
While the fact they are sourced./manufactured from China does not necessarily mean poor quality, certain unscrupulous vendors have spoiled the pot by consistently supplying low qualilty junk.
In regards to Ebay, they these sellers know that most buyers will not bother with the refund process and return shipping to China on a $5 product.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have spent best part of the day fiddling around reconfigureing evertything back from working with TinBootloader and with PuTty but I still cannot make my 16F1937 give up its secretive I2C bus information.
I have everything setup the way you have in your video, Display and RTC on the 16F1937 I2C bus, Pk3 connected to the target device and i2cHardwareDiscovery to Terminal_Alternative_Display_16F1937.gcb programmed on the device - Nothing!
I'm not happy with some of the settings on PuTty but I would have expected something in the output pane.
Are you getting nothing on your PC?
If so, change the code.. somewhere before the main user program add. Now. I am assuming serial hardware is set up.
Share a photo of setup. If you are not getting "." on the terminal we need to get that first.
Nothing on my PuTty Screen
Here are some pics and screenshots of my setup :
Tell me about you connection between the microcontroller and the PC. Direct, via a TTL converter or any other method.
And, a top down foto would show the connected ports.
The microcontroller is connected to my Pkit3...
Oh Hell. never, I must try this out as you have just given me a clue as to what I'm doing wrong. I'll get back to you soon.
You have a few choices... one includes laughing.
Let us know how you resolved the issue... my first sentence, in my last posting, should be you a clue.
And, you may be even luckier... this chip supports SCKP... set SCKP =1 So, you dont need that TTL converter. :-)
Whilst you are at it have a look at your Putty settings and turn OFF the hand shaking.
In photo 3 it shows flow control as Xon/Xoff that should be set to None.
Thank you Chris, that is a big help.
@William Did you receive my mail on Friday evening? I wasen't sure about your reply to address.
Yes I receive. Please check your Email
I have now manged to combine all three devices 16F18326, DS1307 RTC and the SSD1307 GLCD using the ICSP TinyBootloader. with the fantastic help, encouragement and support from William Roth and Evan Venn - A very grateful thank you
attached is some scratch code for a Day, Date and time with leading 0’s on the Date and time. The project uses the TinyBootloader on Pins 12 and 13 (ICSPCLK & ICSPDAT)
I have advanced my project to incorporate some clock button inputs for time adjustments and hour counters for recording running hours etc. which I will publish when completed.
Great job!
Thank you for your kind remarks Evan, Praise form the Gods – Wow!!
Being aware of the possible limits of the 16F18326 I want to incorporate an eeprom or an I2C NVR on the bus. One problem I am having is how do I write and read to a device on the bus rather than the eeprom on the 16F18326, what is the syntax to address such a beast?
As you already have a DS1307 why not use that for your NVR.
The DS1307, in adition to the RTC, also containes 56-Byte, Battery-Backed, General-Purpose
RAM with Unlimited Writes.
You just read and write it the same way as the other registers in the DS1307, no special code needed.
Cheers
Chris
Last edit: Chris Roper 2017-05-05
Do you have an example of how to use this Chris?. I'm in a vertical learning curve (if such a thing exists!) with this.
Sorry Keith, I have not used it in GCBASIC so I can't Help you there, but I
do know that the commands are included in the GCBASIC DS1307 so if you are
using the Library for your time functions you already have the NVM
Functions too. I suggest you look in the Header file or any documentation
you used to get the DS1307 working.
Cheers
Chris
DS1307_Write( DS_Addr, DS_Value)
DS1307_Read( DS_Addr, DS_Value)
Evan
As in the library functions below:
and
Keith mentioned earlier that he had one of those DS1307 I2C fleabay modules. That has a 32kbit, 4kbyte eeprom on board, if more data space is required. It has the same I2C address as other eeproms like the 24LC256. It also has a place to mount a DS18b20 temp sensor on there too if you want. Pullup resistor already in place, just hookup the 1-wire "DS" pin and it is ready to go.
Would that have shown up in I2C Discovery as 0xD0 and 0XD1 (or something similar)?
What other test can be completed to see is the eeprom is available?
Here were my defines for the DS1307 I2C module eeprom, but I think Keith went to solo DS1307, somewhere along the way?
From the data sheet reference:
Hi Kent and thank you so much for your help. Yes, you are right I have not one but two of those DS1307 I2C modules, they are ideal for poking about and learning how things tick.
with. The eeprom I want to access is siting at 0xA0.
I really need to fully understand what makes these tick for when I come to the PCB design. I don't like cobbling things together Heath Robinson style.
I'm pleased I raised this issue, I was wondering what the three drillings with the TO92 outline was for on RTC module. This is going to come in really useful as my next project after this is a temperature alarm monitor for our two freezers.
Last edit: Keith 2017-05-05
I ordered and received one of the DS1307 Modules like Keith has. When I removed the device from the package the battery holder & battery fell fell right off of the board due to poor solder joints. Inspection showed more bad solder joints so I reflowed the whole board in a toster oven and them manually resoldered the battery holder back on. It needs to be noted that the batter is a reghargable LIR CR2032 and that putting a regular CR2032 battery on this board could lead to an explosion.
There seems to be no datasheet availabe for this cheap module and no explanation of the what the "DS" pin is for... or what the optional transistor is for. My guess is it for charging the battery but who knows?
After the repairs and adding header pins to the module, I2C discovery shows all three devices present. LCD module at 0x7E, DS1307 at 0XA0 and the (24C32) EEPROM Device at 0xA0.
The "ATMEL" 24C32 EEPROM can be used with the I2CEEPROM.h.library I (highly) modified one of the I2C EEPROM Demos for the PICI6F18346 and it seems to works OK. This EEPROM uses 32 byte page writes so that needs to be set properly in Source Code.
Attached is the modified Demo Program for the 24C32 EEprom using a 16F18346.
@Keith, change chip to 16F18326 & Change PPS/ I2C Pins as needed for your setup.
Last edit: William Roth 2017-05-06
William, I follow all GCB topics whether I fully understand them or not. Please post the ebay link to the DS1307 I2C device you purchased. This will help me understand the thread more completely.
Thank you,
CJ
I purchased from Amazon Prime so as not to wait for China Post and customs delays. I seldom purchase anything from Ebay anymore unless it is the ONLY source for a specific device.
https://www.amazon.com/JBtek-DS1307-AT24C32-memory-Arduino/dp/B00UUR8GJU/ref=sr_1_1?ie=UTF8&qid=1494078696&sr=8-1&keywords=ds1307+rtc+module
Thanks for the link. Funny though. Nothing I've received from China has fallen off the board or had a cold or dry solder joint....and I get a lot of stuff from them. :-)
CJ
You have been lucky.
Look at the Amazon reviews for this and others like the ones from SainsMart.
While the fact they are sourced./manufactured from China does not necessarily mean poor quality, certain unscrupulous vendors have spoiled the pot by consistently supplying low qualilty junk.
In regards to Ebay, they these sellers know that most buyers will not bother with the refund process and return shipping to China on a $5 product.