Geekzone: technology news, blogs, forums
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


484 posts

Ultimate Geek

#257316 25-Sep-2019 17:07
Send private message

I have an Adeunis LoRa pulse counter connected to The Things Network. I can send it downlink frames to change registers in it.


From the documentation:


Page 72 gives some detail on the registers able to be changed. I have successfully changed register 301 to 5 mins by sending 41 01 00 05 (the extra 00 is because S301 register's size is 2 bytes).


However what would I send to change 321 to Value 1 - this uses Hexadecimal instead of Decimal, and uses bits 0 to 2 for the configuration. Any ideas?

Create new topic
4 posts

Wannabe Geek

  #2324736 25-Sep-2019 17:44
Send private message

Short Answer: same as you did for decimal (provided value is less than 10).


Long Answer:


Hexadecimal is the same as decimal for numbers from 0 to 9, then it uses letters A to F to represent decimal 10 to 15.


With 2 bits there are four possible values which as Binary, Decimal, Hexadecimal are:


00, 0, 0 


01, 1, 1 


10, 2, 2


11, 3, 3  (not used for your device)


To distinguish between the various bases, binary is often written as 0b01, and hexadecimal as 0x01



1418 posts

Uber Geek

  #2324747 25-Sep-2019 18:47
Send private message

Hex and decimal are represented exactly the same way from the point of view of the computer.


What the documentation appears to be doing is using the term decimal to represent a number, and hexadecimal where individual bits or groups of bits need to be set. That's not strictly correct, both will do the job perfectly well. It's possibly due to the fact that C (which the firmware is likely written in), doesn't have a way to represent binary numbers, only hex and decimal.


Register 321 is simple as it's a single byte. Simply setting the value to 0, 1 or 2 should work.


320 is more complicated as it has two distinct functions, each of which use 4 bits. It's unclear which are the high and low bits, but one would need to be shifted 4 bits to the left. In C, this would mean assigning (value_chan_a << 4) | value_can_b, assuming the most significant bit controls Channel A, to set both channels (they cannot be set independently). The value of value_chan_n can use decimal or hex notation, it matters not to the computer.

Create new topic

News »

Vodafone enables 5G roaming - for when international travel comes
Posted 30-Oct-2020 15:03

Spark awards funding to Kiwi businesses in 5G funding initiative
Posted 30-Oct-2020 14:58

Huawei launches IdeaHub Pro in New Zealand
Posted 27-Oct-2020 16:41

Southland-based IT specialist providing virtual services worldwide
Posted 27-Oct-2020 15:55

NASA discovers water on sunlit surface of Moon
Posted 27-Oct-2020 08:30

Huawei introduces new features to Petal Search, Maps and Docs
Posted 26-Oct-2020 18:05

Nokia selected by NASA to build first ever cellular network on the Moon
Posted 21-Oct-2020 08:34

Nanoleaf enhances lighting line with launch of Triangles and Mini Triangles
Posted 17-Oct-2020 20:18

Synology unveils DS16211+
Posted 17-Oct-2020 20:12

Ingram Micro introduces FootfallCam to New Zealand channel
Posted 17-Oct-2020 20:06

Dropbox adopts Virtual First working policy
Posted 17-Oct-2020 19:47

OPPO announces Reno4 Series 5G line-up in NZ
Posted 16-Oct-2020 08:52

Microsoft Highway to a Hundred expands to Asia Pacific
Posted 14-Oct-2020 09:34

Spark turns on 5G in Auckland
Posted 14-Oct-2020 09:29

AMD Launches AMD Ryzen 5000 Series Desktop Processors
Posted 9-Oct-2020 10:13

Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.

Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron

Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.