VOGONS


PS/2 to Serial Mouse protocol converter

Topic actions

Reply 60 of 125, by SquallStrife

User metadata
Rank l33t
Rank
l33t

Hmm.

Best way to check is to hook up an oscilloscope I guess. I would build it myself, but I don't have PICs, nor PIC programmers. I have facilities to program AVR's, but that doesn't help here.

VogonsDrivers.com | Link | News Thread

Reply 61 of 125, by sklawz

User metadata
Rank Member
Rank
Member
feipoa wrote:

sklawz, thank you for this additional information.

I was unable to get the converter functional. Windows 98 claims there is no mouse. When I connect a standard serial mouse, Win98 has no trouble finding it. I have triple checked all connections, tried two seperate 5 V power sources, programmed two PIC chips, and tried two MAX232 chips. I tried it without any of the optional jumpers enabled.

It is really going to be much easier to test this by booting into DOS mode and using mouse.com 8.20 (search for mouse820.zip).

You can place a bi-colour LED or a logic probe on RA2/3 to see if the device correctly resets when the host toggles RTS as mouse.com is loaded.

If the above doesn't happen you have probably incorrectly wired something, double check the routing of RB0.

If the device resets but the mouse is not detected then double check the routing of RB2.

If absolutely nothing happens, double check in your PIC programming software that the correct CONFIG bits are set as found in the HEX file:

__CONFIG _CP_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLRE_OFF & _PWRTE_ON & _WDT_OFF & _INTOSC_OSC_NOCLKOUT

feipoa wrote:

The MAX232 chip I used calls for 1 uF caps. I only have two 1 uF ceramic caps and plenty of electrolytic caps. I tried using the two 1 uF ceramic caps and 3 electrolytic caps, as well as using five electrolytic caps for the MAX232. The 1 uF electrolytic caps measure 1.45 uF on my LCR meter. The 1 uF cermaic caps measure 0.97 uF. So the cap value is one area of uncertainty.

I connected only the two serial lines noted on the mouse.png.

Unfortunately, I am unable to invest much time into this. Does anyone else plan on assembling this?

Good luck

Bye.

EDIT: correction for logic probe

Reply 62 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

There are so few components and connection points to setup up with this unit. Considering that I have checked this many times, pulled everything apart, and rebuilt it, it is unlikely a problem with wiring.

It is possible my IC's are both bad or that the PIC isn't getting programmed correctly. I am using the Automatic/Intel setting to program the HEX file using a low-cost Wellon universal programmer. There are no programming errors.

As sklawz pointed out, the next course of action is troubleshooting. Unfortunately I won't have time to do this for awhile. I am going to wait to see what keropi comes up with. Reviewing this thread, it seems he also ordered some components. In the meantime, I'll put in an order for some ceramic 1 uF caps.

Plan your life wisely, you'll be dead before you know it.

Reply 63 of 125, by sklawz

User metadata
Rank Member
Rank
Member

Hi

feipoa wrote:

There are so few components and connection points to setup up with this unit. Considering that I have checked this many times, pulled everything apart, and rebuilt it, it is unlikely a problem with wiring.

It is possible my IC's are both bad or that the PIC isn't getting programmed correctly. I am using the Automatic/Intel setting to program the HEX file using a low-cost Wellon universal programmer. There are no programming errors.

As sklawz pointed out, the next course of action is troubleshooting. Unfortunately I won't have time to do this for awhile. I am going to wait to see what keropi comes up with. Reviewing this thread, it seems he also ordered some components. In the meantime, I'll put in an order for some ceramic 1 uF caps.

You must check RA2 and RA3. If the PIC is working they will be the complement of each other and will toggle each time the PIC is RESET with RTS.

On first boot RA3 is high and RA2 is low.

If this is not the case then you have an issue with your programmer.

It may be writing the program code correctly but failing to write the CONFIG word. With the PIC16F628A the CONFIG word is written differently to the PIC16F628 for example. This may be a hardware peculiarity or a bug, who knows, but the programming software must support it correctly.

You can't necessarily trust the software you are using.

Bye.

PS. Refer to data sheet DS41196F for clarity and see http://dev.kewl.org/k8048/Src/pic14.c function pic14_write_config() for implementation detail.

UPDATE: Not sure if this relates exactly to your programmer but you can look at this http://www.weilei.com/lyb/showe.asp?id=7575

Additionally here is the hexadecimal value of the CONFIG word:

pi3:~> k14 c
[2007] [CONFIG] 3F10

[CP] Code memory code protection off

[CPD] Data memory code protection off

[LVP] Low voltage programming disabled

[BOREN] Brown-out reset disabled

[MCLRE] MCLR disabled

[PWRTE] Power-up timer enabled

[WDT] Watchdog timer disabled

Oscillator selection:
[INTOSC] 100 NO CLKOUT

Reply 64 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

Thanks for the additional information. RA2 and RA3 both remain high (LEDs on).

That link does relate to me as I am also having the same problem that this user posted. I am using a VP-390. Weilei makes these Wellon programmers.

I think the problem is related to the writing of the PIC program.

The Config options agree with what you noted. See attached images. The uncertainty is what to put in for ID0, ID1, ID2, ID3, and the "secure" option.

When loading the HEX file, there are also the options for "from file mode", "from buffer mode" (e.g. even, odd, 1st byte of 4, etc), "clear buffer options", "to buffer address", "from file address", "file size", etc.

The "Clear buffer options" change what is in the ID1, ID2, ID3, and ID4 fields of config.

I am not sure where to place the following options:
[2007] [CONFIG] 3F10

I tried putting ID1 = 03, ID2 = 0F, ID3 = 01, and ID4 = 00. I've tried the ID's with all FF's and all 00's, but still get both RA2 and RA3 LEDs aftive after powering up the circuit.

Any idea what the missing ingredient is?

EDIT: There are seperate selectiosn for the PIC16F628 and PIC16F628A. I have selected the *628A.

Attachments

Plan your life wisely, you'll be dead before you know it.

Reply 65 of 125, by sklawz

User metadata
Rank Member
Rank
Member

Hi

feipoa wrote:

Thanks for the additional information. RA2 and RA3 both remain high (LEDs on).

This should never happen. BTW, my advice above is correct except that RA3 and RA2 are immediately toggled after initialisation and will read RA3 low and RA2 high. Never will both be high during the course of running the firmware.

Further to the above, there is no circumstance where a blank PIC16F628A should hold RA2 and RA3 high. By default these pins will be inputs with no voltage present.

feipoa wrote:

That link does relate to me as I am also having the same problem that this user posted. I am using a VP-390. Weilei makes these Wellon programmers.

I think the problem is related to the writing of the PIC program.

This could be true.

feipoa wrote:
The Config options agree with what you noted. See attached images. The uncertainty is what to put in for ID0, ID1, ID2, ID3, a […]
Show full quote

The Config options agree with what you noted. See attached images. The uncertainty is what to put in for ID0, ID1, ID2, ID3, and the "secure" option.

When loading the HEX file, there are also the options for "from file mode", "from buffer mode" (e.g. even, odd, 1st byte of 4, etc), "clear buffer options", "to buffer address", "from file address", "file size", etc.

The "Clear buffer options" change what is in the ID1, ID2, ID3, and ID4 fields of config.

I am not sure where to place the following options:
[2007] [CONFIG] 3F10

I tried putting ID1 = 03, ID2 = 0F, ID3 = 01, and ID4 = 00. I've tried the ID's with all FF's and all 00's, but still get both RA2 and RA3 LEDs aftive after powering up the circuit.

Any idea what the missing ingredient is?

EDIT: There are seperate selectiosn for the PIC16F628 and PIC16F628A. I have selected the *628A.

USER_CODE ID0/4: NO CHANGE (NOT IMPORTANT)

OSCILLATOR TYPE: INTRC I/O (OKAY)

SECURE: DISABLE (If this is PROGRAM CODE PROTECTION then when enabled it's impossible to read and export the firmware)

WDT: DISABLE (OKAY)

POWER-UP TIMER: ENABLE (OKAY)

BROWN-OUT RESET: DISABLE (OKAY)

LOW VOLTAGE PROGRAMMING: DISABLE (OKAY)

DATA EEPROM MEMORY CODE PROTECTION: DISABLE (OKAY)

MCLRE: DISABLE (OKAY)

It looks okay, however, just because the vendor has added the device to it's supported list doesn't mean that they ever bothered to test it.

Program the device with security off then perform a firmware dump or export which may be 'READ' on the button bar.

Upload the export here and I will inspect it. The CONFIG word should be 3F10 at address 2007 when programmed and of course when exported.

Bye

Reply 66 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

There is something going on with the programmer. When I open your mouse.hex file in the Wellon software, address 400E has value 10 and address 400F has value 3F. It should read address 2007: 3F, 2008: 10. I have tried modifying these values in the Wellon HEX editor, such that address 400F and 400E have FF values, and address 2007/8 have 3F10 values, but when I program the PIC, read back the program data, and display it on the editor, 2007/8 have values FF/FF. Any idea what is going on here? I've included a sample HEX file of this madness.

Attachments

  • Filename
    PIC_Read_Back_HEX.zip
    File size
    2.82 KiB
    Downloads
    76 downloads
    File license
    Fair use/fair dealing exception

Plan your life wisely, you'll be dead before you know it.

Reply 67 of 125, by sklawz

User metadata
Rank Member
Rank
Member

Hi

feipoa wrote:

There is something going on with the programmer. When I open your mouse.hex file in the Wellon software, address 400E has value 10 and address 400F has value 3F. It should read address 2007: 3F, 2008: 10. I have tried modifying these values in the Wellon HEX editor, such that address 400F and 400E have FF values, and address 2007/8 have 3F10 values, but when I program the PIC, read back the program data, and display it on the editor, 2007/8 have values FF/FF. Any idea what is going on here? I've included a sample HEX file of this madness.

Try this HEX file instead:
http://dev.kewl.org/misc/mouse/mouse.h16

The difference here is that the first file is in Intel hex 32 format and this latter file in Intel hex 16 format. This could be the problem.

Good luck

Bye

RE-EDIT: As an explanation, it would seem that the programmer doesn't support Intel hex 32 format which is the standard for Microchip.
There is the option in your dialog to load Intel hex 16 format, use that option with the new hex file presented above.

Reply 68 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

HEX16 is having the same issues as HEX32. I tried updating the Wellon software and VP-390 firmware, but now it won't even read the HEX files. There seems to be issues with this budget item that I'll continue to fiddle with.

Plan your life wisely, you'll be dead before you know it.

Reply 69 of 125, by sklawz

User metadata
Rank Member
Rank
Member

Hi

feipoa wrote:

HEX16 is having the same issues as HEX32. I tried updating the Wellon software and VP-390 firmware, but now it won't even read the HEX files. There seems to be issues with this budget item that I'll continue to fiddle with.

With INHX32 (Intel hex 32) hex files addresses are stored x 2 for microchip 12 and 14-bit word PICMicros such as the PIC16F628A.

This correlates with your previous finding that 2007 was displayed as 400E.

I have never used INHX16 hex files before, but inspection suggests that addresses are stored exactly as-is with 2007 being 2007.

Eg. hex 32 file:

:02400E00103F61

hex 16 file:

:012007003F1089

In both cases we can see the CONFIG word of 3F10 embedded slightly differently.

Try again when you can and double check that you select intel 16 file format and not automatic when using the intel hex 16 file.

Bye!

Reply 70 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

I have updated to the latest software and firmware successfully. Now when I open your hex values, I only get FF on 400E and 2007. Do your HEX files have values stored for 2007/8? How are they getting removed upon opening your file?

When I manually put in 3F/10 to 2007/2008, it just won't get written to the PIC; only FF is written to these addresses. Same case wheter or not I have enabled "Prog Config".

When I open the Edit Configuration box, I can move "Secure" to "Disable", but the next time I open the Configuration box, it goes back to "Enable". I wonder if this is somehow related to not being able to write to 2007H?

Before I updated the Wellon software and firmware, I tried your HEX16 file, but was still unable to write to address 2007/8, as verified by reading back the PIC contents into the buffer.

sklawz wrote:

double check that you select intel 16 file format and not automatic when using the intel hex 16 file.

Upon loading the HEX16 file, the Intel HEX16 is automatically selected.

Plan your life wisely, you'll be dead before you know it.

Reply 71 of 125, by sklawz

User metadata
Rank Member
Rank
Member

Hi

The CONFIG word is at 2007 and is 14 bits wide. 2008 doesn't come into play here. The CPU is 8-bit but the instruction and config file is 14 bit. This is possibly unlike other architectures you may be familiar with.

All I can suggest is that they added the identity for these PICMicros without actually testing that writing the 14-bit CONFIG actually worked correctly?

You may need to investigate how anyone has successfully programmed any PICMicro with one of these units.

Bye.

Reply 72 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

Oh, I thought each address stored 8-bits? That's how the Wellon HEX editor makes it look. Refer to attached images. I guess this is where things are going wrong. The Wellon software is not expecting each address to correspond to 14-bits.

As such, the 10 3F ends up around the 4000 address point, while the 2007 address is FF.

Attachments

  • Filename
    8-bit_HEX_Address_2.png
    File size
    23.35 KiB
    Downloads
    19 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    8-bit_HEX_Address_1.png
    File size
    37 KiB
    Downloads
    21 downloads
    File license
    Fair use/fair dealing exception

Plan your life wisely, you'll be dead before you know it.

Reply 73 of 125, by sklawz

User metadata
Rank Member
Rank
Member

Hi

feipoa wrote:

Oh, I thought each address stored 8-bits? That's how the Wellon HEX editor makes it look. Refer to attached images. I guess this is where things are going wrong. The Wellon software is not expecting each address to correspond to 14-bits.

As such, the 10 3F ends up around the 4000 address point, while the 2007 address is FF.

Yes, this makes life a little more confusing. The 12-bit and 14-bit word PICMicros address the program file differently to other architectures with program address locations storing 12 or 14 bits of data and register address locations storing 8 bits of data like elsewhere.

You can read about this unusual scheme of doing things if you research the `harvard architecture'.

With regard to your predicament then I will think about it a while 😀

Bye!

Reply 74 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

The only other programmer I have is an official Microchip starter kit, the PICkit 1, http://ww1.microchip.com/downloads/en/DeviceDoc/40051D.pdf

It can only program up to a 14-pin DIP though; PIC16F628A is 18-pin. Can your HEX program be adapted to work on a PIC16F684 (14-pin)?

Plan your life wisely, you'll be dead before you know it.

Reply 75 of 125, by sklawz

User metadata
Rank Member
Rank
Member

Hi

Firstly, here is a flash dump of my working PIC16F628A

> k14 f
[0000] 28BD 3FFF 3FFF 3FFF 28C2 00A5 01A6 01A7
[0008] 0BA7 2808 0BA6 2808 0BA5 2808 3400 3EFF
[0010] 1D03 280F 3400 00A5 3001 200F 0BA5 2814
[0018] 3400 00A5 3018 200F 0BA5 281A 3400 00A6
[0020] 300A 2019 0BA6 2820 3400 1003 3004 00A6
[0028] 01A7 01A8 1C05 3400 0BA8 282A 0BA7 282A
[0030] 0BA6 282A 1403 3400 1003 3020 00A6 01A7
[0038] 1805 3400 0BA7 2838 0BA6 2838 1403 3400
[0040] 00A9 300C 2013 1683 1303 1485 1283 1303
[0048] 1683 1303 1005 1283 1303 300C 2013 1683
[0050] 1303 1085 1283 1303 3004 2013 1683 1303
[0058] 1405 1283 1303 01AA 3008 00A5 2025 1803
[0060] 28BC 0CA9 1803 286A 1683 1303 1085 1283
[0068] 1303 2870 1683 1303 1485 1283 1303 0AAA
[0070] 2034 1803 28BC 0BA5 285E 2025 1803 28BC
[0078] 0CAA 1C03 2881 1683 1303 1085 1283 1303
[0080] 2886 1683 1303 1485 1283 1303 2034 1803
[0088] 28BC 2025 1803 28BC 1683 1303 1485 1283
[0090] 1303 2034 1803 28BC 2025 1803 28BC 2034
[0098] 1803 28BC 01A9 2025 1803 28BC 2034 1803
[00A0] 28BC 3008 00A5 2025 1803 28BC 0CA9 3000
[00A8] 1885 3080 04A9 2034 1803 28BC 0BA5 28A3
[00B0] 2025 1803 28BC 2034 1803 28BC 2025 1803
[00B8] 28BC 2034 1803 28BC 3400 1283 1303 30A8
[00C0] 00A3 0085 1283 1303 3005 201F 0823 3AFC
[00C8] 00A3 0085 3000 00A4 0086 018B 018C 3007
[00D0] 009F 1683 1303 018C 300F 0081 3003 0085
[00D8] 30FF 0086 3033 0099 3020 0098 1283 1303
[00E0] 3090 0098 081A 081A 3090 008B 304D 2125
[00E8] 30F6 2040 1803 28E8 30FF 2040 1803 28E8
[00F0] 209A 1803 28E8 209A 1803 28E8 30F3 2040
[00F8] 1803 28E8 3014 2040 1803 28E8 30E8 2040
[0100] 1803 28E8 3000 1B06 3801 1B86 3802 2040
[0108] 1803 28E8 30E6 1A86 30E7 2040 1803 28E8
[0110] 30F4 2040 1803 28E8 209A 1803 2914 0829
[0118] 00A0 209A 1803 28E8 0829 00A1 209A 1803
[0120] 28E8 0829 00A2 2129 2914 1E0C 2925 0099
[0128] 0008 1A06 2934 1003 1A20 1403 0CA1 1003
[0130] 1AA0 1403 0CA2 2946 30FF 1A20 06A1 307F
[0138] 1BA1 00A1 30FF 1A20 06A1 30FF 1AA0 06A2
[0140] 307F 1BA2 00A2 30FF 1AA0 06A2 0822 3A80
[0148] 1D03 294D 307F 00A2 2950 30FF 06A2 0AA2
[0150] 30C0 1820 3820 18A0 3810 1B21 3801 1BA1
[0158] 3802 1B22 3804 1BA2 3808 2125 0821 393F
[0160] 3880 2125 0822 393F 3880 2925 3FFF 3FFF

We can notice the word alignment and addressing.

feipoa wrote:

The only other programmer I have is an official Microchip starter kit, the PICkit 1, http://ww1.microchip.com/downloads/en/DeviceDoc/40051D.pdf

It can only program up to a 14-pin DIP though; PIC16F628A is 18-pin. Can your HEX program be adapted to work on a PIC16F684 (14-pin)?

Secondly, I only have two 14-pin chips. In fact you can see what chips I have at http://dev.kewl.org/k8048/Doc/#supported

I would appear to have the PIC16F688 and a PIC16F676. Only the former of these has a UART. The F684 has no UART.

It is feasible to code a software UART as there is no time penalty doing so it was just extra effort I didn't consider worthwhile doing.

HOWEVER, looking at the PICKIT1 and it's turned pin socket, you could easily use wires to patch into the breadboard, a DIY ICSP.

If you need advice with that, then just ask.

Bye.

Reply 76 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

The PICkit 1 supports these MCU's,

- PIC12F629, 635, 675, 683,
- PIC16F630, 636, 676,
- PIC16F684, 685, 687, 688, 689, 690, 785
- PIC16F913, 914, 916, 917, 946

These are pretty cheap to come by on eBay. They are under $2 each, shipped.

Please let me know if you are willing to adapt the HEX for any of these MCU's.

Alternately, yes, I'd like to know how to use the PICkit 1 to program the PIC16F928A using an ICSP wire patch.

Unfortunately, I think this is getting to be more work than most people here are willing to undergo. Many users here have a Wellon programmer, so this is still the primary target. I have already sent Wellon an e-mail concerning this issue. Judging by the quality of their responses to the weilei forum, my expectations from them are low.

Plan your life wisely, you'll be dead before you know it.

Reply 77 of 125, by sklawz

User metadata
Rank Member
Rank
Member

Hi

feipoa wrote:
The PICkit 1 supports these MCU's, […]
Show full quote

The PICkit 1 supports these MCU's,

- PIC12F629, 635, 675, 683,
- PIC16F630, 636, 676,
- PIC16F684, 685, 687, 688, 689, 690, 785
- PIC16F913, 914, 916, 917, 946

These are pretty cheap to come by on eBay. They are under $2 each, shipped.

Please let me know if you are willing to adapt the HEX for any of these MCU's.

Alternately, yes, I'd like to know how to use the PICkit 1 to program the PIC16F928A using an ICSP wire patch.

Unfortunately, I think this is getting to be more work than most people here are willing to undergo. Many users here have a Wellon programmer, so this is still the primary target. I have already sent Wellon an e-mail concerning this issue. Judging by the quality of their responses to the weilei forum, my expectations from them are low.

I won't make a new project file. I chose the PIC16F628A for a few reasons.

1. Very cheap
2. Easy to source
3. Has an interrupt pin
3. Has a hardware UART

I just checked the F688, at first site it looks okay but doesn't have the INT feature. I don't want to spend any more time on this to be honest.

It would be best if you get your programmer working. I have supplied the HEX files and shown the CONFIG bits. I cannot do any more.

BYE!

Reply 78 of 125, by keropi

User metadata
Rank l33t++
Rank
l33t++

feipoa , maybe you can consider building a programmer device from here: http://picpgm.picprojects.net/hardware.html (there are some simple parallel and serial ones there) and use PICpgm to do the programming?
The "PICPgm LVISP" seems to be fine for the PIC16F628A ...

🎵 🎧 PCMIDI MPU , OrpheusII , Action Rewind , Megacard and 🎶GoldLib soundcard website

Reply 79 of 125, by feipoa

User metadata
Rank l33t++
Rank
l33t++

Sklawz, thank you for your diligent replies. I have offloaded this problem onto Weilei for the time being. According to them, they are investigating the issue.

keropi wrote:

feipoa , maybe you can consider building a programmer device

If I had time. I will be quite busy with more important obligations for the next while. I really only have time to mess with this in the middle of the night, which has been adversely cutting into my sleep. I played around with this quite a bit today, which has put me behind in other work. The 686 benchmark comparison and testing this PIC are probably the last retro hardware activities I'll engage in for some time.

I have already tried 3 commercial converters which I was unhappy with, so I do not want to spend any more cash on this endevour. If someone else does, I think the PICKit 2 can program this PIC without any additional effort on your part. It will be about $60 shipped. Otherwise, if I had a good pre-programmed PIC that I could test with and pass off this design, I'd be more inclined to dish out the $60 for the kit. As it stands, there is too much risk. For now, I am hoping Weilei will fix their programmer issues.

Plan your life wisely, you'll be dead before you know it.