Trying to run the RTC for first time on Spinneret
T Chap
Posts: 4,223
I get a successful status LED on running the S35390A RTC Setup, it fails if I change the pin assignments to the RTC on the Spinneret so I am assuming the chip is connected during the setup. I get -1 returns on trying to test the chip with the following code. Any suggestions on what to do here?
CON _clkmode = xtal1 + pll16x ' The clkfreq is 80MHz. _xinfreq = 5_000_000 ' Demo board compatible. _rtcclkpin = 28 ' -1 if unused. _rtcdatpin = 29 ' -1 if unused. _rtcbuslck = -1 ' -1 if unused. _statuspin = 23 ' Status LED pin number. OBJ pst: "Parallax Serial Terminal" rtc: "S35390A_RTCEngine" VAR PUB Init dira[_statuspin]~~ repeat 5 outa[_statuspin]~~ waitcnt(5_000_000 + cnt) outa[_statuspin]~ waitcnt(5_000_000 + cnt) pst.Start(115200) pst.Clear pst.str(string("Start PST")) pst.dec(rtc.RTCEngineStart(_rtcdatpin, _rtcclkpin, _rtcbuslck)) ' -1 waitcnt(1000000 + cnt) repeat pst.dec(rtc.readTime) ' -1 waitcnt(1000000 + cnt) pst.LineFeed waitcnt(80000000 + cnt)
Comments
Actually, after adding the extra code to read the specific values I get good results. Sorry
-1
12
4
10
Next task, to learn how to use the SD card on the Spinneret. Looking through the various SD related objects. If there is a recommended starting point for a demo that would be welcome.
The Spinneret forum has a lot of information. There's also a Spinneret code repository containing sample code and libraries.
1. Create a file ErrorLog. On an error, open the file, append Mo/Day/Hour/Min/Errorbytecode
2. At some frequency, upload all errors with time stamp to a remote server and/or allow access to the errorlog file remotely from the internet accessing the Spinneret and view as html page.
3. Transfer Propeller binary to SD card remotely over internet, verify the written file either with checksum or complete comparison with the original at the source computer. Transfer binary on SD to eeprom.
4. Email user(s) of errors
5, Log access times with fingerprint or code entry to file AccessLog. Email the log at some frequency, and/or allow access to view log as html page remotely.
Pushing stored data is always a bit trickier than a plain old Request/Response. I like to send errors or informational message in real time to another server via HTTP POST. It's far less overhead, easier to manage, and extensible.
I did this a while back. It's not difficult but there are few moving parts. If I did this over again I would use a staging server to hold the binary image. Then send a message to the Spinneret to GET the image from the staging server.
There are SMTP demos in the repo. I'm not a fan of emailed error alerts. My inbox is full of 'em at work which I ignore until a real person sends me an email.
I'm sure what you mean by a fingerprint or code entry. I assume you want to know who accessed the Spinneret? If so, that would mean sending credentials on each request. You can find basic authentication in the code repo under the W5200 directory. You can also log the client IP address. Like item 2, I would send a POST request to some other server to log access events.