I have a Hewlett Packard dx2300 computer with Vista Service Pack 2, 32 bits, and Intel processor.
I also have a Toshiba Satellite C850D-11C computer with Windows 8, 64 bits and AMD processor.
Both computers can load, and run example programs like "Blink" to my Arduino Uno. No problems with that.
I have made a Java program that sends data to Arduino Uno via USB cable. Four of UNO's
output pins are connected to a AD9850 Direct Digital Synthesis (DDS) that is working as local
oscillator in my my home made shortwave receiver.
The program is functioning ok when I use the HP computer that has 32 bits Vista.
When I use the Toshiba computer with Windows 8 the program does not work.
How I start the UNO and the Java program:
The computer and UNO are connected to each other with an USB cable.
I start the Arduino 1.0.5 program.
Then I open the Serial Monitor window.
Then I close the Serial Monitor window.
Then I turn on the power to the DDS.
Then I start my Java Program in the computer.
If the computer is my HP computer I can now set the frequency of the DDS signal as I like.
The RX LED in UNO lights each time when I change the frequency by pushing arrow keys on the computer.
If the computer is my Toshiba computer nothing happens to the DDS and the RX LED does not light when I
try to change the frequency. Instead a file named COM11 is created.
This is the program in UNO:
/* Rx0_9600
Sets the frequency of DDS for my radio receiver.
Gets data from Java-program RxFreq3.java
*/
byte myPins[] = {6, 7, 9, 3};
void setup() {
byte BlackLed = 13;
pinMode(BlackLed, OUTPUT);
digitalWrite(BlackLed, LOW);
Serial.begin(9600);
for(int i = 0; i < 4; i++)
pinMode(myPins[i], OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() == 1) {
byte bitt;
bitt = Serial.read();
for(int i = 0; i < 4; i++){
digitalWrite(myPins[i], bitRead(bitt, i));
}
}
}
End of UNO program.
The part of the Java program that writes to the COM port looks like this:
try
{
FileOutputStream ff = new FileOutputStream(RxFreq3.comName); //HP: comName is COM4, Toshiba: comName is COM11
for (int ii=0; ii<135; ii++){
ff.write(frUpdateClockDataMKL[ii]);
BDelay2.bDelay2(RxFreq3.delay, 0); // bDelay, makes 1 millisecond delay
}
ff.close();
}
catch (IOException e)
{
System.out.println("Error " + e.toString());
}
End of Java part that writes to COM port.
Moderator edit:
</mark> <mark>[code]</mark> <mark>
</mark> <mark>[/code]</mark> <mark>
tags added.