Pages

Friday, 9 February 2024

Testing Anko CR2032 cells in Joule Smasher Led Flasher

I first wrote about how bad no-name CR2032 cells are here. As well as proving to be rubbish in the Joule Smasher Led Flasher (JSLF), they also proved short lived in a car remote. Which made me wonder if the JSLF could be a useful way of testing different brands of CR2032 cells.

Since I needed a new battery for the car remote I brought a pack of 4 Anko CR2032 cells from K-mart.  Almost immediately I could see how much better they were than the no-name rubbish from Crapbay. The best of the no-name cells had dropped below 3.2V within 2.5 hours.The worst example was almost immediately below 3.2V.

However, the Anko cell was still above 3.2V at the 6 hour mark. Present indications are it will hit 3.2V at the 7 hour mark. The next few days will give me some confidence in my purchase!

4 Pack Button Cell Batteries - CR2032 - Kmart

Sunday, 4 February 2024

Automatic Backup Lighting - V2.0 Amendments

Some small changes:

use a LED to indicate the presence of a charging voltage

replace the LM317's in the charging circuit with a 5V regulator feeding a 3.4V regulator. Current limiting is now via a resistor between the 5V rail and the 3.4V regulator.

Used hardware to control if charging circuit is connected to battery instead of software.


Serial Data Transmission with RF - Receiving Notes Part 3

In preparation for range testing I made a leap of faith and decided to improve the speed of the receiver code with still more assembly code. I felt the code was fast enough. However, but I wanted to be sure that if I sent two packets with a short gap, say 2ms, that the receiver would be ready 2ms after the previous packet finished

It was a relatively smooth exercise. That's testament to how the design choices in STM8 eForth set it apart. And the power of Forth itself. Interactively testing at the console is so far in front of a "compile upload debug" model many languages require.

So after fetching 9 pulse lengths (PL) I did a thumb suck on how long it would take:

9 PL x 10 clock cycles to process each PL = 270 clock cycles.

Say 20 clock cycles to use the byte received

Clock speed of 16MHz means 290 clock cycles equates to ~18uS

So even if the next byte starts 50uS after one finishes then the micro should be ready. Now I'm comfortable that I can send multiple bytes with a short delay and missed packets are the result of being out of range.

 

Lesson learned - the preamble should never be a start pulse.

I had a hunch, given the strange stuff going on today, that the soldering of the receiver to the base board needed touching up. That seemed to transform the receiver and now there was no noise between bytes on the data pin.  I thought that was a real win. 

While the noise returned, which really annoys me, it turned out to be masking another issue. As it turn out, grabbing the 9th pulse when there was no noise meant the preamble from the following packet was grabbed. So the time it took to  process the 9 pulses, while short, meant that the measured pulse length for the next start byte was just outside the window I had allowed. So that byte was skipped altogether.

It took me some time to work this out. The grabbing of 9 pulses was a relic of when a packet commenced with 2 start pulses. Far better, in my opinion, to simplify the processing of received pulses to only have one START pulse. That way you don't have to deal with the possibility of an extra start pulse.  So far better that the preamble is nothing like a start pulse.