PDA

View Full Version : Pic16f84(a) w/20 Mhz Osc Serin/out commands with PBC



RichardC
- 24th February 2006, 07:09
I saw how to make an adjustment for different clock osc in PBP with the "def osc" command. How do I do that with PBC? I bought a relay board with the 20Mhz already installed and I want to use Serin and Serout commands to talk to a pc. I saw that the 20Mhz was 5x faster than the 4 Mhz and therefore would increase the speeds by 5, but I can't match up baud rates. So is there a way to tell PBC that I am using a 20Mhz clock so that I can match up baud rates?

Darrel Taylor
- 26th February 2006, 22:22
Hi Richard,

I don't use PBC, and this is only one of the reasons.

PBC is made to work with PIC's running at 4mhz. There is no DEFINE OSC equivelent. If you want to run at a higher speed then EVERYTHING has to be adjusted manually.

If you want a 1 second pause you have to PAUSE 5000.

PULSIN's read 5 times longer.

PULSOUT's are 5 times shorter

SERIN/OUT become problems since the baud rate is selected by Mode numbers and can't be calculated for other baud rates.

etc. etc.

You might want to consider Upgrading to PBP.   Or, for $1.50, change the crystal back to 4mhz.
<br>

RichardC
- 27th February 2006, 06:13
Thanks Darrell. I wish I had understood the limitations of PBC a little better b4 I got into all of this. I'm working on my first Pic project. I started looking at the 8051's but ended up with Pic because I found more books about programming in Basic for Pics. My eyes glaze over when I look at assembly, especially more complex tasks like serial communications and pwm. I may eventually go the C route if I continue playing with Microcontrollers because there is so much code available in C. I'm fasinated by the power of Microcontrollers and the incredible range of things you can do with them. I wanted to take a good look at how to program them and build circuits for them without investing a whole lot of money in case I decided it wasn't for me. I started with John Iovines book, 'Pic Microcontroller Project Book' which is pretty easy reading as far as Pics go. John pushes PBC and actually states to not get the PBP version because of how it handles Peek and Poke. Thats where I made the wrong turn. The good news is that I played around with PBC enough to know that I need something more powerful and that I like it enough to invest the additional cash for PBP. Anyway, thanks for your help and I hope this thread proves helpful to other newbies like me.

RichardC
- 27th February 2006, 06:21
BTW, Your instant interupts - revisited is AWSOME!!

Thanks again!