Mouse problems with the Propeller
dover
Posts: 9
I have been having no success with more than one mouse on the propeller proto board. The schematics say that the mouse pins are the same for both the demo and proto board, yet I have tried programs written for the demo board with no success. The program below was written in C using the Image Craft Propeller compiler. It loops, and scanning for a mouse each time, and displays the result of the search on the screen. According to the mouse.h header file, a 0 will be returned if no mouse is found, which is what I always get. I have tried the sample SPIN programs that come with the Propeller Tool spin compiler without success. Does anyone have any ideas, since I have tried several programs, and two different PS2 mice? I will not be able to answer any posts for about a week.
#include <stdio.h>
#include "mouse.h"
#include "vga_text.h"
#define VGA_TEXT_SCREENSIZE (900 * 1440)
int mouse = 0;
int buttons = 0;
int save = 0;
int xt;
void main(void)
{
vgaText_start(16);
while(1)
{
vgaText_setCurPosition(0, 10);
vgaText_dec(mouse);
printf("\b\b\b%d", mouse);
vgaText_setColors(6);
mouse_start(24, 25);
mouse = mouse_present();
}
}
#include <stdio.h>
#include "mouse.h"
#include "vga_text.h"
#define VGA_TEXT_SCREENSIZE (900 * 1440)
int mouse = 0;
int buttons = 0;
int save = 0;
int xt;
void main(void)
{
vgaText_start(16);
while(1)
{
vgaText_setCurPosition(0, 10);
vgaText_dec(mouse);
printf("\b\b\b%d", mouse);
vgaText_setColors(6);
mouse_start(24, 25);
mouse = mouse_present();
}
}
Comments
If the initial assumption is true I'd suggest moving the mouse startup next to the vgaText startup call. What did your SPIN test code look like?
The two programs that are attached are the sample SPIN programs that are included as examples for the Propeller Tool. When I run these programs, like the VGA_Tile_Driver_Demo2, the VGA text, etc, are displayed, and the yellow cursor even appears, but no matter how much you move the mouse, no action occurs. Note: The SPIN program VGA_Tile_Driver_Demo2 must have the .txt file, lincoln, in the same directory as SPIN program, when compiled.
The mouse I am using, and tested on a PC, uses a laser, so you can easily tell if the mouse at least has power. The mouse always lights up as soon as the propeller receives power.
[FONT=Courier New, monospace]
#include <stdio.h>
#include "mouse.h"
#include "vga_text.h"
#define VGA_TEXT_SCREENSIZE (900 * 1440)
[/FONT][FONT=Courier New, monospace]int[/FONT][FONT=Courier New, monospace] mouse = 3;
[/FONT][FONT=Courier New, monospace]int[/FONT][FONT=Courier New, monospace] buttons = 0;
[/FONT][FONT=Courier New, monospace]int[/FONT][FONT=Courier New, monospace] save = 0;
[/FONT][FONT=Courier New, monospace]int[/FONT][FONT=Courier New, monospace] xt;
[/FONT][FONT=Courier New, monospace]void[/FONT][FONT=Courier New, monospace] main([/FONT][FONT=Courier New, monospace]void[/FONT][FONT=Courier New, monospace])
{
mouse_start(24, 25);
vgaText_start(16);
[/FONT][FONT=Courier New, monospace]while[/FONT][FONT=Courier New, monospace](1)
{
vgaText_setCurPosition(0, 10);
vgaText_dec(mouse);
printf([/FONT][FONT=Courier New, monospace]"\b\b\b%d"[/FONT][FONT=Courier New, monospace], mouse);
vgaText_setColors(6);
mouse = mouse_present();
}
}[/FONT]
What type of mouse are you using? Only wheel mouse types are supported.
I don't remember seeing any over-run handling in the PASM driver.
The older 2/3 button mice make lots of bad packets.