PC serial initialization - need to emulate Propeller Tool "Identify Hardware"?
technopol Posts: 12
in Propeller 2
I wrote a program in Purebasic running on windows which talks to my P2 device through serial port at 921600 baud asynchronous full duplex. All works fine BUT I need to initialize(?) the PC port by at least executing the "Identify Hardware" function from the Run menu in Propeller tool IDE before starting communication to my P2 device.
What is missing in my Purebasic program? Can I just emulate what the IDE does when running Identify Hardware?
You probably need to set the signal lines. The usual P2EVAL / PropPlug type serial ports use DTR to reset the chip, so if that line is active the chip won't respond. Ideally you toggle it with a bit of a delay to reset the chip and then talk to it.
Cool, thanks. All I need now is a way to access DTR signal from Purebasic. It seems easy when on Linux; but I thing I'll have to use Windows API function to reach it.
OUch!!!!!! Now I look ridiculous. Thanks a lot, I really didn't check correctly.
I fiddled with the DTR, didn't work. I added delays, it started to work. Then I removed the DTR toggle and only kept a Delay(142).
It seems like I just can't talk to my board right after I opened the serial port in Purebasic, had to wait 142 ms (running @ 100MHz) and all is good!
Thanks for the help!