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

307 posts

Ultimate Geek

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

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 quote this post

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



940 posts

Ultimate Geek

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

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

Twitter and LinkedIn »

Follow us to receive Twitter updates when new discussions are posted in our forums:

Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:

Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:

News »

Logitech introduces new Made for Google keyboard and mouse devices
Posted 16-Oct-2019 13:36

MATTR launches to accelerate decentralised identity
Posted 16-Oct-2019 10:28

Vodafone X-Squad powers up for customers
Posted 16-Oct-2019 08:15

D Link ANZ launches EXO Smart Mesh Wi Fi Routers with McAfee protection
Posted 15-Oct-2019 11:31

Major Japanese retailer partners with smart New Zealand technology IMAGR
Posted 14-Oct-2019 10:29

Ola pioneers one-time passcode feature to fight rideshare fraud
Posted 14-Oct-2019 10:24

Spark Sport new home of NZC matches from 2020
Posted 10-Oct-2019 09:59

Meet Nola, Noel Leeming's new digital employee
Posted 4-Oct-2019 08:07

Registrations for Sprout Accelerator open for 2020 season
Posted 4-Oct-2019 08:02

Teletrac Navman welcomes AI tech leader Jens Meggers as new President
Posted 4-Oct-2019 07:41

Vodafone makes voice of 4G (VoLTE) official
Posted 4-Oct-2019 07:36

2degrees Reaches Milestone of 100,000 Broadband Customers
Posted 1-Oct-2019 09:17

Nokia 1 Plus available in New Zealand from 2nd October
Posted 30-Sep-2019 17:46

Ola integrates Apple Pay as payment method in New Zealand
Posted 25-Sep-2019 09:51

Facebook Portal to land in New Zealand
Posted 19-Sep-2019 18:35

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.