Programming a PIC 12F510 using the DIY-150 programmer

A correspondent asked how to program a PIC 12F510 used in one of my projects using his DIY-150 programmer.

The DIY-150 programmer is quite an old design and there has been no development for more than 10 years, meaning no new chips added, though there are lots of online sellers of the now stale design.

The 12F510 is very similar to the 12F509 which microbrn v150807 does support. The 12F510 can be programmed by selecting chip type 12F509.

Alternatively, download the archive below and extract a modified chipdata.cid file which includes a 12F510, and extract it to replace the existing installed file.

The revised chipdata.cid can be downloaded here: chipdata.7z.

(tr)uSDX IMD performance

(tr)uSDX uses less common techniques for generation of an SSB telephony signal at modest power (a few watts).

There are aspects of the techniques that might raise questions as to how well they work, questions that do not seem to be addressed by the developers.

Wide signal / distortion reports

Whilst there are lots of videos where users demonstrate making QSOs with the (tr)uSDX, credible evaluation of common reports of wide transmit bandwidth is scarce, though spectrum displays of excessively wide (tr)uSDX signals on air are not so rare.

One simple objective measure of IMD is that of a two tone test with spectrum analysis.

Two tone test with spectrum analysis

A two tone test calls for combining two equal amplitude non-harmonically related pure sine waves and feeding that to the transmitter input, and observing the spectral distribution on a Spectrum Analyser.

Ideally, the output should be just the two input components frequency shifted by the virtual carrier frequency (in the case of USB). Practical transmitters are not perfect, so there will also distortion products, and a common measure is that of the 3rd order mix at  If F1 and F2 are the frequencies of the two tones (at RF), the third-order distortion products occur on both sides of these tones at 2F2 – F1 and 2F1 – F2.

Above is a figure from an Anritsu application note showing a wider scope of IMD. Distortion products are measured wrt to each of the desired signals or ‘carriers’, and this value is often given relative to those signals as dBc. (The ARRL uses a different method, referenced to two tone PEP.) Continue reading (tr)uSDX IMD performance

Can a diode be used to rectify signals smaller than its ‘threshold’ voltage?

Several articles on this site have used diode half wave detectors down to very low signal levels, well below the commonly perceived ‘threshold’ of the diodes, and it has prompted comments to the effect that this cannot work.

Really simple PN junction diode model

An ideal diode is a device that conducts in one direction with zero voltage drop, and does not conduct in the other direction.

Practical diodes typically have an IV characteristic with a knee at some small forward bias from about 0.2V to 0.6V depending on the nature of the PN junction.

An often used simple model of a practical diode is an ideal diode with a series battery of voltage equal to the offset of that knee, the ‘threshold’ if you like.

This model may be quite adequate when the applied voltage is much larger than the knee voltage, eg if you were rectifying 24V AC.

Practical diodes

Shockley’s diode equation

William Shockley modelled the IV characteristic of a diode as \(I_D=I_S(e^{\frac{V_D q}{n k_B T }}-1)\) where ID is the diode current, IS is the reverse-bias saturation current (or scale current), VD is the voltage across the diode, kB is Boltzman’s constant, T is absolute temperature, q is an elementary charge, and n is the ideality factor, also known as the quality factor or emission coefficient.

\(\frac{k_B T }{q}\) is often known as VT.

Shockley’s equation with n=1 is often known as Shockley’s ideal PN diode.

BAT46

Let’s look at the BAT46 Schottky diode, it has PIV=100V and is very suited to a lot of these higher voltage RF signal projects.

Above is the IV characteristic from a datasheet. They are often not very helpful at really low currents as used in some of these applications, but note the  great temperature sensitivity. Continue reading Can a diode be used to rectify signals smaller than its ‘threshold’ voltage?

(tr)uSDX BS170 woes

(tr)uSDX users seem beset by a number of common problems, and one of them is failure of the BS170 PA FETs.

Further, lots of users have bought replacements that appear as a dead short circuit when wired into the board. This seems to be that pins 1 and 3 are transposed on some product bought online.

These FETs have an integral body diode, and if Source and Drain are swapped, the body diode will conduct, appearing to be a near short circuit on the supply rail in the (tr)uSDX. Continue reading (tr)uSDX BS170 woes

(tr)uSDX unauthorised product and countermeasures

It has been interesting to observe takeup of the (tr)uSDX project.

The project is released under a quite restrictive licence.

Whilst the developers do not make or sell hardware, they exercise control over the hardware and offer hardware manufacturers an opportunity to have their implementation “approved” or “authorised”.

It is not surprising that a number of implementations have appeared that the IP owner regards as infringing his licence, inevitable really as Chinese copyists have little regard for intellectual property.

Who’da thought that “unauthorised” products would appear?

One of the developers posted those rigs will be banned from Firmware updates, so don’t buy that.

My correspondent asked how can he do that? Continue reading (tr)uSDX unauthorised product and countermeasures

Review of inexpensive Chinese thermostat – DST1000

The DST1000 targets the market for inexpensive digital thermostats, the most popular being the STC1000. The novel features to the DST1000 is that it uses  a DS1820B digital temperature sensor (well probably a Chinese clone).

The problem with thermistor based thermostats is that they commonly have significant error, and although most firmware allows the user to enter a calibration adjustment, it is a fix at one temperature and does not solve the problem that the thermistor equation implemented in the firmware does not match the behavior of the thermistor. In my experience, calibrating at 20° might result in an error as much as 5° at 80°, unacceptable for lots of wide ranging applications.

It is sold with brief and inadequate / incorrect user instructions. Two were purchased to give a good chance one would work, and you guessed it, only one worked. The lower display segment of the first digit did not work on the fautly one, and the seller thought that was not a problem. The seller frustrated attempts to obtain a refund for the faulty unit.

Above, the seller’s pic of the DST1000. Continue reading Review of inexpensive Chinese thermostat – DST1000

(tr)uSDX bootloader woes

A reader of my article WriteOptiBoot.bat asked about application to the (tr)uSDX project.

The first point to note is that the (tr)uSDX project uses its own bootloader, and it would appear it is proprietary code (ie secret), and one is entirely dependent on their published information.

A common user problem reported on the the (tr)uSDX project forum is inability to either:

  1. program the bootloader; and / or
  2. program the application code.

Continue reading (tr)uSDX bootloader woes

Garden environmental telemetry project – part 5

Garden environmental telemetry project – part 1 laid out plans for a simple maker / DIY IoT garden environmental telemetry system.

This article documents a change to the sensor configuration and payload formatter adding another temperature and humidity sensor for the greenhouse.

The sensors are now:

  • ID=1 air temperature and humidity;
  • ID=2 soil temperature and humidity.
  • ID=3 greenhouse temperature and humidity.

The payload contains an 8bit payload version number then six 16bit values for the six sensors. This is parsed by the TTN uplink formatter.

RS485-LN firmware has been upgraded to v1.4. Continue reading Garden environmental telemetry project – part 5

Garden environmental telemetry project – part 4

Garden environmental telemetry project – part 1 laid out plans for a simple maker / DIY IoT garden environmental telemetry system.

This article documents a change to the sensor configuration and payload formatter in preparation for another RS485-LN.

The sensors are now:

  • ID=1 air temperature and humidity;
  • ID=2 soil temperature and humidity.

The payload  contains a 8bit payload version number then four 16bit values for the four sensors. This is parsed by the TNN uplink formatter.

function decodeUplink(input) {
  var payver=input.bytes[0];
  switch(payver){
    case 1:
      return {
        data: {
          field3: ((input.bytes[3]<< 8)|input.bytes[4])/10,
          field4: ((input.bytes[1]<< 8)|input.bytes[2])/10,
          field5: ((input.bytes[7]<< 8)|input.bytes[8])/10,
          field6: ((input.bytes[5]<< 8)|input.bytes[6])/10
        },
      warnings: [], // optional
      errors: [] // optional (if set, the decoding failed)
      };
    case 2:
      break;
    }
  }

Above, is the Custom Javascript formatter which writes the measured values into variables fields3-field6 of the data object.

To be continued…

Garden environmental telemetry project – part 3

Garden environmental telemetry project – part 1 laid out plans for a simple maker / DIY IoT garden environmental telemetry system.

Earlier experiments highlighted the disadvantage of analogue sensor connections. This article reports tests on sensors connected using digital signals.

Above is the Dragino RS485-LN LoRaWAN end node, about $90 incl shipping. In this application it will be used to read two MODBUS sensors (each with two data channels) and forward the data to The Things Network via LoRaWAN, then after some processing, RESTFUL submission to Thingspeak. Continue reading Garden environmental telemetry project – part 3