1 registered members (AndrewAMD),
1,018
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Serial Communications Header
[Re: the_mehmaster]
#282110
07/30/09 12:20
07/30/09 12:20
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I dont see why not, assuming the pic uses a decent serial routine, and you connect via a max232 line driver for a guarantee, unreliable otherwise.
I dunno if I can just "throw" together even something that simple, looking at my archives, I haven done any actual MP-Lab PIC coding since October 2003 ! Ive got the parts, but the skills may be a little weak. And Im on day-shift which limits my "play" time.
But I'll give it a try... Gimma a couple of days...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Serial Communications Header
[Re: EvilSOB]
#282230
07/30/09 21:08
07/30/09 21:08
|
Joined: Dec 2008
Posts: 528 Wagga, Australia
the_mehmaster
User
|
User
Joined: Dec 2008
Posts: 528
Wagga, Australia
|
My programmer was also my testbed (LEDs, SerialPort with max232, switches, lcd). And it cost quite a bit too. I think I'll try and fix it before i buy a new one. I'd like to see how you'll go though..
|
|
|
Re: Serial Communications Header
[Re: the_mehmaster]
#282235
07/30/09 22:11
07/30/09 22:11
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Definately fix first... PM me on this and I may be able to help fault-find.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Serial Communications Header
[Re: EvilSOB]
#283648
08/09/09 01:21
08/09/09 01:21
|
Joined: Dec 2008
Posts: 528 Wagga, Australia
the_mehmaster
User
|
User
Joined: Dec 2008
Posts: 528
Wagga, Australia
|
In response to 27 fault-finding PMs: Yes!.. YEs!.. YES! It Works now! All i did was resolder the ICSP header, And it works! I've never missed a programmer so much.. I guess you can easily take things for granted Couldn't have done it without you, evilSOB.. Thanks! Now all i have to do is learn hitech C ..
|
|
|
Re: Serial Communications Header
[Re: kasimir]
#285079
08/16/09 22:44
08/16/09 22:44
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I'd give you a hand if I could figure out the device name of the mouse. According to the API documentation it SHOULD be able to. Ive not played with and true USB devices yet. I tested this code with a USB-to-Serial adapter, but windows recognised it as a serial port, so it doesnt really count as a USB test like you are requesting.
I'll do a bit of digging and see what I can come up with though.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Serial Communications Header
[Re: EvilSOB]
#285723
08/19/09 19:23
08/19/09 19:23
|
Joined: Dec 2005
Posts: 490 Germany/Berlin-Velten
kasimir
Senior Member
|
Senior Member
Joined: Dec 2005
Posts: 490
Germany/Berlin-Velten
|
thx, if found following three commands, but i am not able to get them running:
usbhandle = CreateFile( ...USB PORT GUID...,
GENERIC_WRITE,
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
0 );
-> here i get an error - GENERIC_WRITE, FILE_SHARE_WRITE, OPEN_EXISTING do not exist... ???
DeviceIoControl( usbhandle, 0x04, pIn, sizeof(szIn), pOut,
sizeof(szOut), lpByte, NULL );
0x04 pIn szIn pOut szOut ...are specific port-functions/ bites to read... and
CloseHandle( usbhandle );
|
|
|
Re: Serial Communications Header
[Re: kasimir]
#285782
08/20/09 04:21
08/20/09 04:21
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I dont follow what you are actually asking for questions 2 and 3. But or question 1, here are all the "contants" I ever used. I ended up hard-coding the values into the functions to reduce the source-file complexity-of-reading.
#define GENERIC_READ 0x80000000
#define GENERIC_WRITE 0x40000000
#define FILE_SHARE_READ 0x1
#define FILE_SHARE_WRITE 0x2
#define CREATE_NEW 0x1
#define CREATE_ALWAYS 0x2
#define OPEN_EXISTING 0x3
#define OPEN_ALWAYS 0x4
#define TRUNCATE_EXISTING 0x5
#define FILE_FLAG_OVERLAPPED 0x40000000
#define OF_READ 0x0
#define OF_WRITE 0x1
The problem with convrting my code to be USB friendly is finding/retrieving the "...USB PORT GUID...". I just cant figure out how...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Serial Communications Header
[Re: kasimir]
#285882
08/21/09 03:22
08/21/09 03:22
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I couldnt get enything to go. But Im still VERY unsure if I was using the correct GUID.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|