M-BUS and Picaxe- I got the data, need the picaxe to output it

rs2845

Senior Member
Amplify a Picaxe PWM signal without distorting data

Hello,


This question is a little off-topic. It's regarding the Meterbus (M-Bus) protocol. I have a couple of alarm sounders that use this protocol to communicate and be controlled by a master (usually a compatible control panel). What I'm trying to do is capture the communications between the control panel and a sounder (got this) so I can get a picaxe to speak to the sounders instead. The challenge is matching the physical connections and the software so a Picaxe 40X2 can mimic some very simple tasks.

I've been told that this is definitely possible as the panel and devices all use pic16 micro controllers and that an oscilloscope can be used to capture the waveform of specific commands alongside the timings of each square wave. I have managed to "sniff" some of the commands that the panel uses to trigger these sounders. I just need to get my cheapo sainsmart oscilloscope to save the waveform to an sd card.

My question is, how can I get my picaxe to output a specified square wave signal but then amplify the voltage between 17-24v? The highest peak is 23.6v and the trough of the waveform is 17.3? The pwm voltage is far too low and I'm not sure how I can amplify this without distorting the actual data output.

As always, I look forward to hearing from you all!

Side question- If anyone knows how I can get my DSO201 oscilloscope to save to a fat16 sd card let me know! I can then provide some captured waveforms.
 
Last edited:

hippy

Technical Support
Staff member
It might be possible with a PICAXE. It's basically a two wire power bus also carrying serial on the power rails. It seems comms can be bi-diectional but are fundamentally serial, 300 to 9600 baud, though does use parity. It's hard to tell how complicated the protocol is with just a quick read through but, from page 14 onwards, would seem a good starting point ...

www.m-bus.com/files/MBDOC48.PDF

It might turn out easier than it looks but there seems to be a lot to get one's head round in understanding it all.
 

Buzby

Senior Member
Reading the datasheet shows the comms protocol is quite complicated, but I'm sure it can be handled by a PICAXE. ( State machines, maybe. )

Also, M-Bus has an unusual physical interface.
Signals from Master to Slave indicate '1' & '0' by a voltage change from +36v to +24v ( but see datasheet for some further important details. )
Signals from Slave to Master pass data by changing the current drawn the bus, from 1.5mA to 11mA or 20mA.

I think your best idea here is to get hold a TSS721 interface IC. ( Maybe a free sample from TI )
 

rs2845

Senior Member
Totally forgot I posted this. I felt like I had mid-way through re-posting. Good job I checked.

So I contacted TI, no free samples for this part unfortunately. Don't mind buying the bit I need the master building before I use a transceiver slave.


Ive seen this M-Bus communication used with some much simpler Microchip PIC16's compared to the 28x2's and 40x2's I'll be using. Obviously there were a fair few other components like capacitors and resistors (I assume connected as voltage dividers).


Does anybody have any ideas on how I can get going with this? I have the M-Bus source... I also have captured some signals with an oscilloscope and know the timings for certain hi's/lo's in the data that I'd like the Picaxe to interpret.
 

hippy

Technical Support
Staff member
In your opening post you say you have been told it is definitely possible; it may be worth talking to those people to discover how they would recommend doing things as they likely know more about the bus than anyone here.

As for a general strategy; I would recommend getting reading from the bus working first, then controlling devices, then integrating the two together.
 
Top