Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:27 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : BMC Menchester Code

Author Message
Teo1
Newbie

Joined: 06/05/2023
Location: Romania
Posts: 25
Posted: 09:01pm 25 Jun 2023
Copy link to clipboard 
Print this post

Hi,
Can anyone help me decode a BMC-Menchester signal?
Thank you in advance,
Teo
 
hhtg1968
Senior Member

Joined: 25/05/2023
Location: Germany
Posts: 123
Posted: 09:46pm 25 Jun 2023
Copy link to clipboard 
Print this post

do you talk about


https://en.wikipedia.org/wiki/Manchester_code


?
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 897
Posted: 06:53am 26 Jun 2023
Copy link to clipboard 
Print this post

This link describes BMC.

BiPhase Mark Code and Manchester Code
It looks to describe a hardware decode.

A PicoMite CSUB to  timestamp pin changes (Manchester code?)

Capturing 433MHz code on Picomite (Manchester code?)

The above links might gives some ideas to decode in software on the Picomite.
Latest F4 Latest H7
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6798
Posted: 07:43am 26 Jun 2023
Copy link to clipboard 
Print this post

Whether you can decode it in MMBasic will depend on the data rate. The Pico itself will very likely be capable, but it's a question of timing - especially when decoding.

Welcome to the forum, Teo! :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
circuit
Senior Member

Joined: 10/01/2016
Location: United Kingdom
Posts: 245
Posted: 07:39pm 26 Jun 2023
Copy link to clipboard 
Print this post

The PICAXE store still lists the NKM2401 chip which is a PIC12F508 microcontroller programmed with Manchester coding/decoding.  Currently listed as out-of-stock.  I have used pairs of these in the past with simple transmitter/receivers and they worked really well.  

Datasheet available here:

https://picaxe.com/docs/axe213.pdf
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 571
Posted: 09:11pm 26 Jun 2023
Copy link to clipboard 
Print this post

The hex file is here NKM2401


 Quazee137
 
circuit
Senior Member

Joined: 10/01/2016
Location: United Kingdom
Posts: 245
Posted: 10:11am 28 Jun 2023
Copy link to clipboard 
Print this post

  Quazee137 said  The hex file is here NKM2401


 Quazee137


Is it?  I cannot access this page, are you able to download a copy?
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3804
Posted: 10:29am 28 Jun 2023
Copy link to clipboard 
Print this post

I can see the file at that URL.

John
 
Teo1
Newbie

Joined: 06/05/2023
Location: Romania
Posts: 25
Posted: 05:26pm 28 Jun 2023
Copy link to clipboard 
Print this post

HI,
First of all, thanks so much everyone for your help.
I need to receive the attached signal and convert it to RS232.
The signal is BMC encoded at 250bps speed, consisting of 22 bits.
In the example given, the first byte has a value of 92.The next 12 bits represent the number 1326, the penultimate bit is for parity and the last bit is for stop. Send LSB first.
Sorry for my English.
Any idea, help will be appreciated!
Thanks in advance !  
Teo


BMC.pdf
 
Quazee137

Guru

Joined: 07/08/2016
Location: United States
Posts: 571
Posted: 05:30pm 28 Jun 2023
Copy link to clipboard 
Print this post

Here
NKM2401.hex.zip


 Quazee137
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 897
Posted: 07:53am 29 Jun 2023
Copy link to clipboard 
Print this post

@Teo

Are you thinking of doing this with a Picomite?

Is the data received continuously. Does it repeat the same data until it changes e.g a temperature etc?

What is the line state when there is no data?

How would it be converted to ASCII for the RS232 e.g. output the twenty bits as 5 hex characters. i.e. 52E5C or does it need decoding.

I think it could be achieved with a tweak of one of the above CSUBs.

Gerry
Latest F4 Latest H7
 
Teo1
Newbie

Joined: 06/05/2023
Location: Romania
Posts: 25
Posted: 05:52pm 29 Jun 2023
Copy link to clipboard 
Print this post

Hi Gerry,
Yes, I use Picomit
Data is received continuously .
Repeat the same data until it changes.
Depends on the state of the last transmission (see attached PDF).
In the example ,in the PDF , we pass 92 in decimal and 1326 in decimal LSB first.  
Thanks in advance !
Teo
 
circuit
Senior Member

Joined: 10/01/2016
Location: United Kingdom
Posts: 245
Posted: 08:44am 30 Jun 2023
Copy link to clipboard 
Print this post

  Quazee137 said  Here
NKM2401.hex.zip


 Quazee137

Thanks for that; when I tried to access the page I was, for some reason, blocked.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4247
Posted: 09:49am 30 Jun 2023
Copy link to clipboard 
Print this post

With 250bps you can do the whole decode in basic. No need for CSUB or PIO.

use timer as time reference
use a GPx set for both edges interrupt

loop until bit counter reaches your threshold
analyze array()

in the interrupt routine
- log pin status + time stamp timer to array()
- increment bit counter

MMBasic is fast enough to keep pace with 250bps.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Teo1
Newbie

Joined: 06/05/2023
Location: Romania
Posts: 25
Posted: 02:34pm 30 Jun 2023
Copy link to clipboard 
Print this post

Thanks a lot !
Teo
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2137
Posted: 11:50pm 30 Jun 2023
Copy link to clipboard 
Print this post

For anyone else that wants to play with decoding Teo's BMC.pdf this produces the data stream on another PicoMite.
'Generate continuous Manchester code stream
OutPin = 1 'GP0
SetPin OutPin, DOUT
'bitstream intervals  1=2000uS ,2=4000uS, 4=8000uS
Dim integer D(32)=(4,4,2,2,1,1,1,1,1,1,2,1,1,2,2,1,1,1,1,1,1,2,1,1,2,2,1,1,2,1,1,2,2)
Math scale D(), 2000, D()

Do
 Bitbang Bitstream OutPin, 33, D()
Loop
Adjust the scale factor if the speed is wrong.
Edited 2023-07-01 18:11 by phil99
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024