In my studies I have to write meter-bus (m-bus) protocol/functions in VHDL. and I have no idea from which point should I start. I read a little bit of http://www.m-bus.com/mbusdoc/default.php but were is a lot of information. Probably some one of you know the right functions list how should it work, or maybe some one have the example, or information how I should do it?
Thanks for your time.
I’d say start from the bottom.
1: Find the necessary transceiver chip (a TSS721 chip according to the physical layer documentation), and get it hooked up to an FPGA. You can probably do a loopback with it, and just try sending and receiving data from the same FPGA.
Interfacing to it seems to be done through a UART, so you can either write one yourself, or use one of the many UART implementations available (if you are using Xilinx Spartan-series or similar, have a look at the PicoBlaze UART implementation).
2: Once the physical layer is working (either as loopback on a single FPGA, or between two FPGAs), carry on with the next layer (the Datalink-layer) and get that working. I can highly recommend familiarizing yourself with a good simulator, which will allow you to test out the layers one by one, instead of having to rely on in-target tests in the FPGA.
3: Proceed to the next layers (Application and Network), until you’re done.
For reference, I built something similar during my master thesis – a custom-made FPGA-based network, using Toslink transceivers. The project can be found here, and the code here – if you’re interested in the full thesis, I can probably dig up the pdf’s somewhere…