Log in

View Full Version : SERIN2 @ 38400 @ 40mhz



skimask
- 28th January 2007, 22:48
I'm away from the house for a couple of months, don't have access to any 'scopes, counters, and all the other gadgets...

I'm trying to get SERIN2 to work at 38,400 baud and having a rough time getting it to be consistent. My PC talks to the unit at 38,400 just fine, but the PIC doesn't. I'm thinking the timing might be just far enough off to cause problems. I can go the hardware route no problem, but the character/string handling capabilities of SERIN2 make it a lot easier to work with for now.

Anyways, here's what I'm trying to use right now:
SERIN2 configs - 1,000,000 / 38,400 = 26; 26 - 20 = 6, that's the mode number if I define OSC 40.

I'm thinking if I do this instead:
1,000,000 / 3,840 = 260 - 20 = 240, there's the new mode number if I define OSC 4 and change the rest of the program accordingly to match the new OSC define (or at least use some other OSC define value that makes a nice multiple of 38,400 baud).

I'm wondering if somebody could try these two options on a 'scope and see which one is closer to the actual 38,400 baud.

mister_e
- 28th January 2007, 22:57
pssst... PicMultiCalc do this for you

http://www.mister-e.org/pages/utilitiespag.html

But frankly, i would use DEBUG instead if you don't need multiple serial ports.

If you use the internal OSC... you better forget it...

skimask
- 29th January 2007, 00:16
pssst... PicMultiCalc do this for you
http://www.mister-e.org/pages/utilitiespag.html
But frankly, i would use DEBUG instead if you don't need multiple serial ports.
If you use the internal OSC... you better forget it...
Right, I know about the PicMultiCalc, works like a champ.

If I use the hardware UART on the PIC, a modified version the software works great, but I lose the ability to use SERIN2's character handling capability, which is really handy.
This tells me that possibly the SERIN2 runs just a bit off spec at 38,400 baud.

When I get the software finished up, I'll permanently switch over to the hardware port and write my own routines to handle strings and such as needed.

Internal OSC? Obviously the only time I trust that is at 2400 and below, without calibrating anyways. After calibration, I've used it successfully up to 115,200.

Darrel Taylor
- 29th January 2007, 02:01
... but I lose the ability to use SERIN2's character handling capability, which is really handy.

As far as I know, HSERIN does everything SERIN2 does. STR DEC HEX BIN etc.

What's missing?
<br>

skimask
- 29th January 2007, 02:08
As far as I know, HSERIN does everything SERIN2 does. STR DEC HEX BIN etc.

What's missing?
<br>

DOH! Forgot about HSERIN.
You're right, nothing missing, any software timing differences aren't a factor...

The serial port pins are already used up by another serial interface running at the same speed, but much less critical. I'll just have to do some rewiring. I don't know why I wired it like that in the first place :)

mister_e
- 29th January 2007, 03:57
http://www.mister-e.org/Pics/YodaRTFM.jpg

skimask
- 29th January 2007, 04:01
http://www.mister-e.org/Pics/YodaRTFM.jpg

SWEET! At least I have a manual :D

mister_e
- 29th January 2007, 04:13
ROFL, so you're one of the few having it here AND you missed ...

HSERIN supports the same data modifiers that SERIN2 does.

??? :D

Just kidding ;)

Archangel
- 29th January 2007, 05:49
http://www.mister-e.org/Pics/YodaRTFM.jpg

http://www.animationartgallery.com/images/WBL/WBL35C.gif
Eeeeese a good ONE !