If you are using the hardware UART, there are some computations which tell's
you the error for various crystals. Take a deep look to the Stef's "usart
common.jal" from the distribution pack and to the microcontroller datasheet
USART section, you will find the formula for error detection and spbrg
computation. But 9600bps must work with 4MHz crystal or the internal
oscillator. The problem is the internal oscillator stability, not the
particular value of the oscillator.


However I've seen at least twice a situation when the usart common.jal does
not compute correct the spbrg value, without being able to catch the
problem. So the question for other guys is how they debug such kind of
errors as long there isn't a valid communication for terminal debugging?

I didn't figure a usefull way of using "pragma error". Old jal had "pragma
test assert " which was a damn good feature. How do you use the "pragma
error" for debugging?

Vasile


On 11/13/09, Wayne <[email protected]> wrote:
>
>
> Hi guys
>
> Finally made some progress on the k107 backpack.  Thanks to a comment
> made by Rob, I tried a 20 Mhz resonator on the 16f628a and it finally
> displayed the 'correct' characters on the LCD.  The same program did NOT
> work using 10,8 and 4 MHz resonators or with the 4MHz internal clock. It
> seems that the 20Mhz clock gets the 9600 baud rate correct while none of
> the others did.  Has anyone else had problems getting the 9600 Baud Rate
> working?  I am using the 'l' version of the compiler (compiled Aug 7 2009).
>
> I had hoped to use the k107 on a 12f509 using the internal clock but
> that does not seem to be possible now.
>
> Wayne
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to