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

336 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



1096 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

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 »

Vodafone New Zealand starts two year partnership with LetsPlay.Live
Posted 28-Jan-2020 11:24

Ring launches indoor-only security camera
Posted 23-Jan-2020 17:26

New report findings will help schools implement the digital technologies curriculum content
Posted 23-Jan-2020 17:25

N4L to upgrade & support wireless internet inside schools
Posted 23-Jan-2020 17:22

Netflix releases 21 Studio Ghibli works
Posted 22-Jan-2020 11:42

Vodafone integrates eSIM into device and wearable roadmap
Posted 17-Jan-2020 09:45

Do you need this camera app? Group investigates privacy implications
Posted 16-Jan-2020 03:30

JBL launches headphones range designed for gaming
Posted 13-Jan-2020 09:59

Withings introduces ScanWatch wearable combining ECG and sleep apnea detection
Posted 9-Jan-2020 18:34

NZ Police releases public app
Posted 8-Jan-2020 11:43

Suunto 7 combine sports and smart features on new smartwatch generation
Posted 7-Jan-2020 16:06

Intel brings innovation with technology spanning the cloud, network, edge and PC
Posted 7-Jan-2020 15:54

AMD announces high performance desktop and ultrathin laptop processors
Posted 7-Jan-2020 15:42

AMD unveils four new desktop and mobile GPUs including AMD Radeon RX 5600
Posted 7-Jan-2020 15:32

Consolidation in video streaming market with Spark selling Lightbox to Sky
Posted 19-Dec-2019 09:09

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.