-
I wondered why we use the LSE with a specific value of 32.768 kHz
Found this answer:
The frequency of a real time clock varies with the application. The frequency 32768 Hz (32.768 kHz) is commonly used, because it is a power of 2 (215) value. And, you can get a precise 1 second period (1 Hz frequency) by using a 15 stage binary counter.
Practically, in majority of the applications, particularly digital, the current consumption has to be as low as possible to preserve battery life. So, this frequency is selected as a best compromise between low frequency and convenient manufacture with market availability and real estate in term of physical dimensions while designing board, where low frequency generally means the quartz is physically bigger.
-
Seems to work:
____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v05.47 (c) 2019 G.Williams > >function getClockSource() { : return ["NONE","LSE","LSI","HSE"][((peek32(0x40021020)&768)>>8)]; :} =function () { ... } >getClockSource(); ="LSE" >
-
No, that's already done - so the next release will have a separate build in it. In fact the 'cutting edge' builds from http://www.espruino.com/binaries/travis/master/ now no longer have networking but do have vector fonts, so they'd work for you.
Is that this one: espruino_2v05.47_espruino_1r3.bin
-
-
-
-
function getClockSource() {
return ["NONE","LSE","LSI","HSE"][((peek32(0x40021020)&768)>>8)];
}
getClockSource();Yes, I have a version 1.3b. One of the first boards I guess?
Your code reports "LSI" so I guess that means the Low-speed internal (LSI) RC oscillator is active?
I will solder the crystal now and see what happens.
Thanks!
-
If you've got other questions, please can you start a new post? Just go to the forum for your type of > board (http://forum.espruino.com/microcosms/1083/ for the original Espruino) then click "Post a > Conversation" in the top right.
Got it! Thanks! :-)
-
-
-
Ok, I tried the following:
- Downloaded espruino_2v04_espruino_1r3.bin and flashed, everything is ok!
- Downloaded espruino_2v05_espruino_1r3.bin and flashed, same error is back...
I Guess none of the 2v05 versions have the vector font...
I'l stick to 2v04 for a while then! :-)
thanks and kind regards,
Reinoud
- Downloaded espruino_2v04_espruino_1r3.bin and flashed, everything is ok!
-
-
I get another error now:
____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v05 (c) 2019 G.Williams > Uncaught Error: No vector font in this build at line 24 col 21 g.setFontVector(20); ^ in function called from system Uncaught Error: No vector font in this build at line 24 col 21 g.setFontVector(20); ^ in function called from system Uncaught Error: No vector font in this build at line 24 col 21 g.setFontVector(20); ^ in function called from system Uncaught Error: No vector font in this build at line 24 col 21 g.setFontVector(20); ^ in function called from system Uncaught Error: No vector font in this build at line 24 col 21 g.setFontVector(20); ^
The board I'm using is an Espruino Rev. 1.3b
-
-
Hi Gordon,
I have a question:
With the previous version the following code ran correctly, but now I get an error:
____ _ | __|___ ___ ___ _ _|_|___ ___ | __|_ -| . | _| | | | | . | |____|___| _|_| |___|_|_|_|___| |_| espruino.com 2v05 (c) 2019 G.Williams > Uncaught InternalError: Timeout on SPI RX at line 1 col 30 b.write([33,191,20,6,32,12],d);void 0!==e&&e() ^ in function called from system >
my code:
A2.write(0); // GND A3.write(0); // light off A4.write(1); // VCC SPI1.setup({ baud: 1000000, sck:A5, mosi:A7 }); var g; var MONTHS = [ "Jan","Feb","Mar","Apr","May","Jun", "Jul","Aug","Sep","Oct","Nov","Dec" ]; function draw() { g.clear(); var t = new Date(); var date = t.getDate()+" "+MONTHS[t.getMonth()]+" "+t.getFullYear(); var time = t.getHours()+":" + ("0"+t.getMinutes()).substr(-2); var secs = ("0"+t.getSeconds()).substr(-2); // top left date g.setFontBitmap(); g.drawString(date,0,0); // middle time g.setFontVector(20); var timeWidth = g.stringWidth(time); g.drawString(time,(g.getWidth()-timeWidth-12)/2,10); // seconds over to the right g.setFontBitmap(); g.drawString(secs,(g.getWidth()+timeWidth-8)/2,26); // send to LCD g.flip(); } function onInit() { clearInterval(); // Setup SPI var spi = new SPI(); // Initialise the LCD g = require("PCD8544").connect(SPI1,A6,B0,B1, function() { // When it's initialised, set up an animation at 20fps (50ms per frame) setInterval(draw, 1000); }); } var next_state = 1; function swap() { A3.write(next_state); next_state = !next_state; } function swap_on_down() { if (digitalRead(BTN1) == 1) swap(); } setWatch(swap_on_down, BTN1, true); onInit();
Do I need to adjust the code for this?
rgds,
Reinoud
-
-
Made a second attempt:
According to my son it was 14,3 degrees. If I understand well it is sent backwards:
0011 0100 0001
But I don't see the string "001101000001" in the following capture:
01001001100001010000001110010111
0
00000
11111111111111111111100100100110000101000000110010111
111
1
0000011111110011111111111111111111111111111111111111111111111111111111111111111>1111111111111111111111111111111111111111111111111111111111111111111111111111111111>11111111111110000000000000000000000000000000000011111111111111111111>1110000000110000000000011111111100000001111111101111110000000000
1110000000000000000000000001
11111111111
11111111
000001111000000111111110111101111000110000000011111111
1100
1111110001111111111111000000000000011
10001
001111
10000001000001110
111
1111111111
110000
1100000000111
1111111111110001111111110000000011100000000000000
11
111110111111111
00001111111110001000000
Disconnected -
Hi Gordon,
I tried to capture it with the code you proposed. I get a constat flow of data, probably stuff from other devices. We tried to solve it by letting my son scream "yes!" when the sensor transmits something (we see a red led flash...) and I disconnect the espruino (don't know how to pause terminal output). What I get is this:
0111111
0000
11111111111111111111111100011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000111110111111111000000000000000110000000000000001111111110000111000000000000000000000110011111111110001111111110110000000001111001111111
010
111111111
00000111
1111110 -
I posted a question on which protocol is used on a weatherstation forum, this is a reply I got:
After some searching, I have determined that the Protocol may be 1.0
or 2.1 protocol. It depends on what series you have. The later
manufactured THR 188, has a 2.1 protocol. It is in any case certainly
not 2.2 or 3.0 protocol.Looking at the bit rate of 342 Hz it is most likely I have a protocol 1 sensor. I also read in the documentation that the manchester coding is used.
-
-
-
-
-
wow! that was indeed a long reply! :-)