Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:58 05 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 : I got aome JDY-41 to play with...

     Page 1 of 2    
Author Message
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6655
Posted: 09:59pm 23 Oct 2024
Copy link to clipboard 
Print this post

...and what a pain they are. ;)

You have to send configuration data to them in hex. In spite of my efforts I've not been able to figure that out in MMBasic - I had to resort to YAT. It was a bit of a struggle but I've finally managed to figure it out, I think. They'll talk to me now.

I'm not sure that the COM system (or serial TX) can send raw binary. Anyone got any ideas other than bitbanging it?
Mick

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

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2088
Posted: 10:28pm 23 Oct 2024
Copy link to clipboard 
Print this post

I have a vague (and probably wrong) idea that someone used LONGSTRING to do it.

  manual said  LONGSTRING PRINT [#n,] src%()
Prints the longstring stored in ‘src%()’ to the file or COM port opened as ‘#n’.
If ‘#n’ is not specified the output will be sent to the console.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3774
Posted: 10:42pm 23 Oct 2024
Copy link to clipboard 
Print this post

  Mixtel90 said  ...and what a pain they are. ;)

You have to send configuration data to them in hex. In spite of my efforts I've not been able to figure that out in MMBasic - I had to resort to YAT. It was a bit of a struggle but I've finally managed to figure it out, I think. They'll talk to me now.

I'm not sure that the COM system (or serial TX) can send raw binary. Anyone got any ideas other than bitbanging it?

It should send binary OK - e.g. use CHR$(...).  It's always sending binary anyway :)

When you say hex, various things talk about hex in various ways, $yz or &hyz or 0xyz where y & z are hex chars, just as a way to refer to numbers (commonly bytes, thus the 2 hex digits).

They then sometimes mean to send a byte (which has the hex value) or sometimes they want 2 or more bytes where each is an ASCII char for the value.

The former is common.  So you can send such as chr$(&hyz) + chr$(...) etc
(if &h is what introduces a hex literal constant; in C it would be 0x).

E.g. CR LF would be chr$(13) + chr$(10) but could be chr$(&h0d) + chr$(&h0a)
The same binary values go out on the wiring whichever of the above you write in your program.

John
Edited 2024-10-24 08:43 by JohnS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6655
Posted: 06:37am 24 Oct 2024
Copy link to clipboard 
Print this post

Thanks John. I'll be having another try because I'd like to be able to handle these in MMBasic if at all possible and at least I know that I have one working and what to expect from it! The manual isn't the greatest. They recommend using a setup program that's shown all in Chinese and is actually something a bit like YAT.

I'd been playing at using CHR$. They just show strings like "ABCD0D0A" and tell you to send it in hex. I've been trying chr$(&hAB)+chr$(&hCD)+chr$(&H0D)+chr$(&H0A) but it might be that it wants individual characters.

Receiving is something else as it won't respond at all if the received string is malformed. However, I've now discovered that it sends <nul>+Ready if you power it off and on again so I have something to look for!

At least I know my test rig works as I was able to plug in a JDY-40 and control that using AT+ codes, which is *much* easier!
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 786
Posted: 06:56am 24 Oct 2024
Copy link to clipboard 
Print this post

Hi Mick,

Don't know if this is any help?

Also, don't forget:


 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6655
Posted: 07:06am 24 Oct 2024
Copy link to clipboard 
Print this post

I saw that neat tool, but not a lot of point in Windows. :)

My eventual aim is for a Library program that reads the config, displays it, then lets  you select the new  values before writing it back. It will save the baud rate so that it knows what was set and will be able to access that module again. From the manual, I *think* each device has a unique part of the device number so even swapping devices makes that a possibility.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3774
Posted: 08:11am 24 Oct 2024
Copy link to clipboard 
Print this post

I'm sure it can be done in MMBasic (*).

Er, I know essentially nothing about JDY-41 so is it a particular device? Which one (or ones)?

(*) unless there's some weird timing needed but doesn't sound like it and even then probably can be done.

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6655
Posted: 08:17am 24 Oct 2024
Copy link to clipboard 
Print this post

there's a link to the manual on that Github page.

It's a strange little module, like the JDY-40. Basically you can use tham as either a wireless remote control (with various functions but all based on 7/8 bits) or as a transparent serial port. Not a great range but very cheap. Great for tinkering with. :)

The JDY-41 is cleverer (and newer) but is more difficult to configure. You wouldn't normally be changing the configuration of these things anyway so it doesn't really matter.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3774
Posted: 08:19am 24 Oct 2024
Copy link to clipboard 
Print this post

  Mixtel90 said  there's a link to the manual on that Github page.

Er... which github page?

John
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 786
Posted: 09:04am 24 Oct 2024
Copy link to clipboard 
Print this post

The link that I posted earlier:

  PhenixRising said  

Don't know if this is any help?
 
tritonium
Newbie

Joined: 16/06/2018
Location: United Kingdom
Posts: 18
Posted: 10:56am 24 Oct 2024
Copy link to clipboard 
Print this post

@Mixtel90

Hi
Looks very interesting but...
You said " From the manual, I *think* each device has a unique part of the device number so even swapping devices makes that a possibility.
The manual isn't the greatest. They recommend using a setup program that's shown all in Chinese and is actually something a bit like YAT."

Is this any better?
https://arduino.ua/files/JDY-41%20Manual.pdf

24 pence on aliexpress!!!! (£2.25 postage)

Dave
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6655
Posted: 11:18am 24 Oct 2024
Copy link to clipboard 
Print this post

You don't buy one! :)  You use them to top up an £8 Choice order. :)
That seems to be the same manual that I have.

I think I've seen a very slightly different version but I can't find it now. I have a feeling it was a link on a German forum.

  Quote  
6.6 Configure device ID instruction
F1AE 11223344 0D0A
F1AE indicates the instruction head
11223344 indicates the device ID is 11223344
0D0A indicates the terminator
Note: the general device ID does not need to be configured. The module comes with the unique ID number
when leaving the factory, and each module is different.
If you need to restore the factory ID number after configuring the ID, please configure the ID to 0 to
automatically restore the factory ID.

.
Edited 2024-10-24 21:19 by Mixtel90
Mick

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

Guru

Joined: 31/01/2014
Location: United States
Posts: 326
Posted: 05:12pm 24 Oct 2024
Copy link to clipboard 
Print this post

If anyone is interested, here is a breakout board I created for the JDY-40/41 modules.  Be kind... It is the first PCB I ever designed. 😲





JDY-40 41 Breakout - V1.1.zip

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6655
Posted: 05:21pm 24 Oct 2024
Copy link to clipboard 
Print this post

That's a nice one. :)  I did one to put on a breadboard quite some time ago.



The gerbers are in the usual place. :)

I've managed to get the thing to send +Start to MMBasic when it's powered up now. Still can't get it to respond to anything. I might try poking the command string with numbers hen sending the finished string.
Edited 2024-10-25 03:22 by Mixtel90
Mick

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

Guru

Joined: 31/01/2014
Location: United States
Posts: 326
Posted: 05:33pm 24 Oct 2024
Copy link to clipboard 
Print this post

@Mixtel90

I liked your design and had an order of boards made. However, the pin header holes were the size of vias making them useless.  Don't know if it was a manufacturing error or a design error. That was what inspired me try and design my own board.

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6655
Posted: 05:48pm 24 Oct 2024
Copy link to clipboard 
Print this post

Ah...The holes were 0.72mm dia. Too small for male headers, as you noticed. :) At that time I used 0.6mm diameter wire (the silver plated copper crafting sort) instead of pin headers as it's kinder to the breadboard. I still do that a fair bit. Unfortunately I keep picking up one particular breadboard that need a hammer to plug anything into it and that bends my skinny wires. :(  

I've now added a version to take conventional pins if anyone wants one.
.
Edited 2024-10-25 03:50 by Mixtel90
Mick

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

Guru

Joined: 31/01/2014
Location: United States
Posts: 326
Posted: 06:15pm 24 Oct 2024
Copy link to clipboard 
Print this post

Good to know I can stop cursing the PCB manufacturer. 🤪  The positive side is I finally got inspired to learn to use AutoTRAX DEX to create my own PCBs.
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3774
Posted: 10:37am 25 Oct 2024
Copy link to clipboard 
Print this post

Looking at the PDF it looks like you do just send (rather odd, often non-ASCII) bytes, so Reset would be CHR$(&hAB) + CHR$(&hE3) + CR + LF

I don't understand the data sheet's SET pin. Maybe has to be controlled as well?

I'm unsure about CS, too.

John
 
Justplayin

Guru

Joined: 31/01/2014
Location: United States
Posts: 326
Posted: 11:04am 25 Oct 2024
Copy link to clipboard 
Print this post

In order to configure, both SET and CS must be pulled low. Then you can send the 14 bytes needed to properly configure the module. Once configured remove the ground from SET, and CS may need to be set high, low or float depending on the programmed configuration used.

--Curtis
I am not a Mad Scientist...  It makes me happy inventing new ways to take over the world!!
 
PhenixRising
Guru

Joined: 07/11/2023
Location: United Kingdom
Posts: 786
Posted: 12:10pm 25 Oct 2024
Copy link to clipboard 
Print this post

You guys keep making me buy stuff....so this is altogether different to BT and WiFi?
 
     Page 1 of 2    
Print this page
© JAQ Software 2024