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 KingdomPosts: 6655 |
...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: AustraliaPosts: 2088 |
I have a vague (and probably wrong) idea that someone used LONGSTRING to do it. |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3774 |
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 KingdomPosts: 6655 |
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 KingdomPosts: 786 |
Hi Mick, Don't know if this is any help? Also, don't forget: |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6655 |
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 KingdomPosts: 3774 |
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 KingdomPosts: 6655 |
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 KingdomPosts: 3774 |
Er... which github page? John |
||||
PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 786 |
The link that I posted earlier: |
||||
tritonium Newbie Joined: 16/06/2018 Location: United KingdomPosts: 18 |
@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 KingdomPosts: 6655 |
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. . 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 StatesPosts: 326 |
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 KingdomPosts: 6655 |
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 StatesPosts: 326 |
@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 KingdomPosts: 6655 |
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 StatesPosts: 326 |
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 KingdomPosts: 3774 |
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 StatesPosts: 326 |
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 KingdomPosts: 786 |
You guys keep making me buy stuff....so this is altogether different to BT and WiFi? |
||||
Page 1 of 2 |
Print this page |