I wanted to use HSERIAL with my computer. I bought a level shifter from SFE, the PRT-00449..
I am pretty sure I have it hooked up correctly. Pin 15 of the Pro goes to the Rx line to the computer, and 14 connects to the computers Tx line.
The little red LED on the level shifter is blinking in succession with the red LED on the BBII, which I had set to blink every loop iteration, so I know there is some data of some kind on the serial line.
Code:
[code]ENABLEHSERIAL
Main
; Temp Variables
i var sword ; everyone’s favorite counter!
; Serial Setup
SETHSERIAL H38400, h8databits, hnoparity, h1stopbits
Loop
for i = -5000 to 5000 step 100
HSEROUT [sdec i, " test", 13]
pause 300
low 12
pause 25
high 12
next
Goto Loop[/code]
At H38400 and below, I seem to be able to get it to work. However, the minute I try H57600, or higher, all I get is garbage on the serial port.
Also, I have a question: Is H125000 the same thing as 115.2k ? Because it seems a very odd number.
Not sure I can help much here. I have used Hserial to connect my Atom Pro to the SSC32, but I am running it at 38400. I assume you ruled out that maybe the PC side had problems at the higher baud rates.
As for the H125000 I am pretty sure it is not the same as 115.2. It is odd, but I believe looking in the h83664 manual table 14.2 on page 189, that the maximum speed of H500000 and the H125000 is the same with the little n set to 1 which divides the clock by 4… But that is just my guess.
Yep, it sure would be. For now I settled for 38.4. Later I thought I might experiment to try to get 115.2. You would probably let HSERIAL initialize everything and then see if I could calculate some values for the registers BBR and the CKS0 and CKS1 bits of SMR that would get me to 115.2, by the formula on page 186 of the hardware manual. I have not done it yet as my guess is that Nathan (AcidTech) would have included it in his hardware defines if the values worked out ok…