DuPAL-PAL-DUmper / DuPAL_Analyzer

This a Java tool that interfaces to the DuPAL board via serial connection. It performs analysis that would be problematic to implement on a MCU.
GNU General Public License v3.0
22 stars 6 forks source link

DuPAL doesn't communicate through USB-RS232 converter on Windows #7

Open zxcygnus opened 3 months ago

zxcygnus commented 3 months ago

I would like read two PAL chips - one is PAL12L6 and second still unsupported PAL20L8 so i built DuPAL and now i am trying do something with it.

I did try it on two computers so far. One is old notebook with W10 Pro 64bit where i installed older JDK 17 and compiled all your programs. Second notebook is another older notebook with installed Ubuntu Mantic where is OpenJDK 22-ea 2024-03-19.

Analyzer compiled on W10 & JDK 17 for some reason on W10 doesn't communicate with DuPAL, any attempt will end with message:

c:\DuPAL>java -jar dupal-analyzer-0.1.5-jar-with-dependencies.jar COM9 12L6 IC9_12L8 3F
[main] INFO info.hkzlab.dupal.analyzer.App - DuPAL Analyzer 0.1.5
[main] ERROR info.hkzlab.dupal.analyzer.App - Unable to put DuPAL board in REMOTE MODE!

I tried several USB-RS232 converters, one with cheap chip CH340 which can be problematic and five with chip original Prolific PL2303 (one of them as ExpressCard but with USB & PL2303 internally, others as USB dongle bought during many years and used many times with other projects, two of them brand new, never used before). I have installed official and latest driver from Prolific's website.

Same USB-RS232 converters works on Linux without any problems, for example if i try read same PAL12L6 as before.

java -jar ./dupal-analyzer-0.1.5-jar-with-dependencies.jar /dev/ttyUSB0 12L6 out-IC09-12L6-2024-05-24.json 3F
[main] INFO info.hkzlab.dupal.analyzer.App - DuPAL Analyzer 0.1.5
[main] INFO info.hkzlab.dupal.analyzer.board.boardio.DuPALAnalyzer - Got 4096 output states!
[main] INFO info.hkzlab.dupal.analyzer.board.boardio.DuPALAnalyzer - saveOutputToFile() -> Saving to out-IC09-12L6-2024-05-24.json

Back on W10 I did try connect to the DuPAL with RealTerm terminal (57600bps, 1 stop bit, no data flow control, ansi mode...), it works fine, when DuPAL is powered on or reseted i realiably got message

DuPAL - 0.1.2

REMOTE_CONTROL_ENABLED

So i assume there is no problem with connection, firmware in AT Mega 328P or USB-RS232 converter. Maybe something wrong could be with driver for that converter in W10 (but it is official, so most people will be using same), or maybe something wrong is with Analyzer and for some reason it is not compatible with this combination? I don't know.

I assume problem can have something to do with way how is DuPAL reseted through RS232. Because i tried many times press reset shortly after Analyzer was started. Once or two times i was succesful and whole reading process was finished.

2024-05-24_dupal_w10_reset_several_tries_+comment

On oscilloscope a can see, RESET signal on pin 1 of ATM3128P is generated and is under 0.5V at least 0.1ms which should be enough. After that there is almost 10ms delay and ATM328P sends message to the PC.

001 MCU pin1 reset 002 MCU pin3 delay between reset and data 003 MCU pin 3 data

It seems to me, MCU behaves correctly, but for some reason, program on PC running under W10 isn't able receive that data? Unfortunatelly, i don't know anything about Java i am not able diagnose it further.

hkzlab commented 3 months ago

Sorry, it seems an issue with your setup. I regularly use my DuPAL on a windows 10 and a windows 11 machine, and with a prolific USB-RS232 adapter too. I used this to get them working: https://github.com/johnstevenson/pl2303-legacy (the default driver windows installs is actually a dummy, non working one, in my case).

zxcygnus commented 3 months ago

Maybe... just for record.

I did use driver downloaded from manufacturer https://www.prolific.com.tw/US/ShowProduct.aspx?p_id=225&pcid=41 and several of my USB-RS232 converters are these https://www.aten.com/eu/en/products/usb-solutions/converters/uc232a/

Problem with original driver can be, it is trying detect counterfeit chips. It did it with another converter which i tested too, but not with Aten UC232A and not with tested Express Card, all of them probably have original Prolific chips inside.

But i will test alternative driver in near future too. We will see.

hkzlab commented 3 months ago

Can't say what is happening there, but with these I'm having no problems under Win 11 (or 10): image

zxcygnus commented 3 months ago

Last two days i did some more tests on freshly installed W10 Pro. I did use another older notebook (slightly faster) - this time it was Thinkpad T420 (Core i5-2520M, 16G RAM, 240G SSD) - just because i could erase it and it has ExpressCard slot too.

USB-RS232 from Aten behaves exactly same as before. For some reason it didn't work with generic driver from Prolific, i must have install specific driver from Aten website which is version 3.8.15.5 published 02.10.2017. Analyzer works even with this USB-RS232, but i must press RESET on DuPAL maybe 0.5s after command is started. At least 6x in row it was successful.

With ExpressCard RS232 (Axago ECA-30) - which uses Prolific driver 3.8.42.0 published 22.02.2023 it work fine. No RESET is needed. It just works.

DSC09336 zmenseno

Maybe, just maybe... could it be, because Analyzer is too slow on old hardware and misses first characters from message transmitted by DuPAL, so RESET will repeat that message and second time it is received properly?

Anyway, i got some data from both PAL chips. Maybe i have equations from PAL12L6... (PAL20L8 still resists) now is time verify the correctness.