Difficulty with Pocket Watch B
I'm trying to get the Pocket Watch B to work with the Javelin, and clearly there's something about the way Uarts work that I don't grasp.
The docs include sample code for the Basic Stamp II. I can run it without a problem.
I converted the code for the Javelin, and it doesn't work. The Uart.receiveByte() calls are returning 0.
Clearly something doesn't work the way I'd expect it to work.
But what?
The docs include sample code for the Basic Stamp II. I can run it without a problem.
I converted the code for the Javelin, and it doesn't work. The Uart.receiveByte() calls are returning 0.
Clearly something doesn't work the way I'd expect it to work.
But what?
txt
![](/plugins/FileUpload/images/file.png)
664B
Comments
Secondly, you need to convert received binary values into readable ascii values
before appending to the stringbuffer.
The Format class allows easy appending and converting.
Try the attached class.
regards peter
I corrected that in the attachement.
regards peter
But I'd not been worried about the formatting of the StringBuffer. I'd been looking at the values placed in the ss, mm, etc. vars, in the debugger, and they'd not been set to anything like reasonable values. In the test program I posted, the receiveByte() call would set each of them to zero. If the output StringBuffer had been formatted correctly, I'd still have had a program displaying incorrect values.
I'm not at home - I can't try out your code, yet. But the only difference in setup I can see is that you are constructing the Uarts during the static initialization phase, and I'm doing it at the beginning of main(). And that shouldn't make any difference.
is specified in BS2 program), maybe that is why it didn't work.
Try the class and see if it works.
regards peter
·
http://groups.yahoo.com/group/JavelinCode/files/Javelin%20Stamp%20IDE/lib/stamp/util/text/
regards peter
That's simply the seconds value. In the Basic Stamp code, I was setting the time to 97-06-03 06:30:00 and the alarm to 97-06-03 06:30:15. In the Javelin code, I was setting both time and alarm to 97-06-03 06:30:00. It's simply a cut-and-paste error, and could have nothing to do with why I'm not getting meaningful values out of Uart.receiveByte().
Ah, well.
Let it lie until I can get home and play with it.
I DL'ed your code, and tried it out.
Nada.
So I tried out the Basic Stamp, again. (I had both Stamps plugged into different spots on the breadboard - I just moved the Pocket Watch and my programming cable.) And it worked fine.
So I powered down, pulled the Basic Stamp and plugged the Javelin in its place. And it worked fine.
For the life of me, I can see no functional difference between the circuit I'd laid out at one end of the breadboard and the circuit I'd laid out at the other. Yet the Javelin+Pocket Watch worked connected to one and not to the other.
I'm thinking I might have a dead tie point on the breadboard.
regards peter
and that works with the BS2 but not with the javelin, right?
regards peter
And the circuit built around the BS2 worked and the circuit built around the Javelin did not.
I'm just getting started with the Javelin, so when it didn't work I assumed I'd done something wrong in the programming.
Yesterday, I put the Javelin in the circuit that I had built around the BS2, and there it worked fine. Clearly there was some difference between the two circuits, though looking at them they seemed to be identical.
In any case, the problem wasn't the code, it was the circuit.