CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

EX_PBUSM Pic to Pic Problem with PIC16f628

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nk5oham
Guest







EX_PBUSM Pic to Pic Problem with PIC16f628
PostPosted: Thu Jan 27, 2005 8:22 pm     Reply with quote

All:

I am using a pic16f628 and am pulling my hair out trying to do Pic-Pic with ex_pbusm example.

It seems that the ninth_bit just doesnt get through - not sure why - but that breaks it all. I am running Pics at 4 MHz - maybe thats too slow... I'm getting parts that will let me run at 20 MHz so thats something that might help.

Just wondering if anyone has any experience or ideas.

Thanks for your attention.

Steve
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Jan 28, 2005 3:59 pm     Reply with quote

I haven't tried that example, but one quick way to test if the
oscillator speed is the problem, would be to drop the baud rate
to 1200 baud. You can do that a lot quicker than ordering new parts.

A few other comments:

1. The PIC-to-PIC communication uses Pin B0, with a 1K pullup.
(and a ground wire).

2. Make sure you have NOLVP in the #fuses statement.

3. The closest chip to your 16F628 in the example would be the 16F877.
Near the end of the of EX_PBUSM.C file, right above main(), they
define a hardware UART on pins C6 and C7. This must be changed
to pins B2 and B1 for the 16F628.
Guest








PostPosted: Fri Jan 28, 2005 9:23 pm     Reply with quote

Thanks for the Reply!

I had tried dropping the baud rate - clear to 300, with no luck. I have NOLVP defined. I'm using pins A3,A4 instead of C6,C7 and I think this should be OK. I have a terminal hooked up to these pins and that is working OK.

The interesting thing is that it all works except for the ninth_bit. If I change the line in the function pbus_isr():

from
if(ninth_bit) {
to
if (pbus_state!=PBUS_NEED_CS && pbus_state>=0x80) {

it all works. Unfortunately, this defeats the purpose of being able to send commands that are differentiated from the data.

I also got my 20MHz crystals today and tried them, but it didn't help.

I could do this a different way, but it really bugs me that it's not working!!!

Thanks for your help and if anything else comes to mind, please let me know.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group