Rev counter goes mad / clock goes off / won't start

The above might seem a stramge mixture of problems, but I'm not sure that they are not connected! Should I publish them in some other place? Is it ok to post questions without answers?

Here are the problems that I have with my 2001 F650CS in N.Spain:

1) engine stalls when changing gear (not good when you are overtaking a lorry on a winding mountain pass). Just before this happened for the 2nd time, I noticed that the rev counter was going mad, it was at 6-7000rpm but real engine speed was around 2000rpm. I don't know the cause of the rev counter going mad, but I assume there is some problem with the crankshaft speed detection system. Evidently, if the engine computer (erroneously) thinks that the engine speed is above idle speed, then when the rider changes gear and momentarily leaves the throttle grip at rest (idle) position, the computer will try to further lower engine speed and it will stall. Any ideas on what could be the root cause?

2) no power when ignition key turned to "on" position. Even the clock is off. Battery voltage is fine (12.5v). This has happened twice and the last time I think that the power went off when I stopped the engine, I deduced this by how much time the clock had lost, when the problem went away ( on it's own) later in the day. I always stop engine by turning ignition key to off position, rather than using the red switch. Any ideas?

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License