-
Flashing via DFU didn't work (the file sent over ok on the app, but nothing happened).
Programming via the J-link on the nRF DK board didn't work either (which was odd).But I found a J-Link Ultra+, and that programmed it just fine. The radio demo seems to be working - thank you for the help.
The current board doesn't have a programming header per-se, so one unit will be kept as the 'radio test unit'. No need for the Espruino .hex, but thanks for offering.
-
Thanks Gordon, all useful advice.
I was on v2.12, but have updated to v2.14 and seen an improvement in timings, although there'll still be one or two long pulses in a second's worth and it still doesn't quite go down to 20us. But I agree it's much improved and if I get fed up with fiddling with timers it's probably good enough to work with.
Thank you for the links re. hardware and examples, I'll have a read up on them.
-
Hi All,
Working on something that needs to produce accurate-ish (+/-20%) pulses down to 20us every 10ms for 1s. I'm currently using a combination of setInterval() and digitalPulse() (see snippet below if interested).With a bit of dialling-in, the 1s duration is reliable enough, setInterval() is working great at 100Hz, and digitalPulse() gives good results at 200us and passable ones at around 140us.
digitalPulse can do 32us, but there's about +40/-0 us of variation in it so it's not ideal. For stuff around 100us things could be fudged so that the +40us sits as +/-20% around 100us, but it doesn't work once you get faster than that.
So the question is, what timers are free to use that don't interfere with Espruino? What timers (if any) does digitalPulse() use? Was thinking of using a one-shot timer triggered over and over by setInterval().
// Timeouts of OFFSET_MS used to account for speed of js execution. Obtain OFFSET_MS empirically. // Timeout to start pulses. setTimeout( () => { tmp1 = setInterval( () => { digitalPulse( PULSE_PIN, true, pulseDuration_ms ); }, CNST_PERIOD_MS ) }, OFFSET_MS ); // Timeout to stop pulses after some time. setTimeout( function(){ PULSE_PIN.reset(); clearInterval(tmp1); }, Duration1_ms+OFFSET_MS);
-
-
Hi All,
We're have a product using an Espruino MDBT42Q, and are looking at running tests in service of the RED (Radio Equipment Directive; an EU thing).
A test house has come back asking if the device can be made to constantly transmit on the lowest, middle, and highest frequency channels one by one (which for BLE would be channels 37, 17, and 39 respectively).
I've looked through the software reference and found the useful 'setTxPower' function, but is there a way to do either or both of constant transmission (doesn't have to be intelligible data) and transmitting over a fixed channel?
-
-
Hi All,
Been a few months developing with Espruino now. After getting my head around javascript it's actually very nice. Scheduling things is a breeze in particular.I've been developing a project off the Espruino and testing with jest, and now it's time to move it onto the Espruino where it should all just work (haha).
The code's being moved in chunks and tested as it goes along. However, after adding the most recent chunk and uploading to RAM I get :
>Uncaught SyntaxError: Got EOF expected ':' at line 1 col 13365 ...Disconnected:256,OverCurren ^ Execution Interrupted New interpreter error: LOW_MEMORY,MEMORY >
at first I thought this was some bug with the minification (the chip has 64k RAM, so it shouldn't (on the face of it) be struggling with 14k of program), but with that turned off I get:
>Uncaught SyntaxError: Got EOF expected '}' at line 752 col 32 tmp = false;//STM.s ^ Execution Interrupted New interpreter error: MEMORY >
So it's the same error, but at a different place in code.
The code as it stands is 14131 bytes when minified, and 33480 bytes as-is.
The console doesn't give any obvious clues, is there some tool available to debug the issue? Or is it that I'm actually out of memory? The code's only ~1000 lines at the moment, but there's another 500 or so to go.
-
-
The bluetooth serial port appears to miss characters. An example screenshot is attached. The specific missing characters in the 'Espruino' header change each time, but the error it gives is the same every time.
The following has been tried after searching on the forums for a bit:
- Resetting the board before sending code
- Power cycling board and reconnecting
- Turning on and off throttling in settings.
It doesn't help that the error message doesn't make any sense. I'm using several local modules in the code, and line 7 in all of them is taken up by a comment containing information about the file (author, purpose, etc...). So the error doesn't specify a module, nor a line with any code on it.
The class mentioned in the error should say 'Electrodes' and 'ElectrodeController()'.
I'm using the native Windows IDE on Windows 10.
Having guessed at which file and line the error was in, the 'ReferenceError' has been fixed (and it wasn't on line 7, 17, 27, or 7x either). Is this kind of behaviour normal? Does the software report where an error was on its minified code instead of the code as written?
- Resetting the board before sending code
-
-
We have a project using the MDBT42Q module, but hardware won't be ready for another month at least.
I've bought a Pixl.js because it has an MDBT42Q module on the back of it. The idea was that I'd develop software using the Pixl.js, then do final testing on the actual hardware later.However, I use pin D27 on the MDBT42Q module, and this doesn't appear to be available on the Pixl.js, and I get an 'Uncaught ReferenceError: D27 is not defined' as a result.
Is there a way of pre-checking code without any hardware connected to the IDE. Like you'd get with compilation using C, but a js equivalent.
-
-
Thanks both, especially for the reference manual. I'm used to register-level stuff in C, so all this high-level abstraction (and in JS no less) is confusing. Seems like it makes difficult stuff easy (the whole BLE stack) but easy stuff more difficult.
Thank you again, is there a way to tag a thread as 'answered'? -
On the MDBT42Q page it says that pin D21 can be configured as 'NRST'. This conflicts with Raytac's datasheet where it says it can be configured as 'RESET'. I couldn't find anything in the API reference as to how to configure the pin.
So questions are:
1) How do you configure the pin to act as reset?
2) Is it active high or active low?Reason being I want to add a brownout detection chip that resets the board if power dips.
Thanks in advance,
Rob
Finally got around to this, and results are excellent. Getting <0.3us jitter.
The examples definitely came in handy, although there's a bit of guesswork involved in sending the right values to the right places.
A working example is included below though that uses a button on D17 to start / stop a train of pulses.
edit - added 'var ll = require("NRF52LL");' at top of example