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

Parallel Comm Project

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







Parallel Comm Project
PostPosted: Tue Mar 14, 2006 9:22 am     Reply with quote

Hello all, I have a question about programming pic18f series pics for parallel communication using PSP.

My project involves communication with another pic using a certain protocol we have established. The packets to be exchanged are of this format

[sync][type][data]

[sync] = 0x05 (this tells me that i'm about to receive data) (1 Byte)
[type] = tells me what kinda packet i'm gonna get (ACK, NACK, data etc)
(1 Byte)
[data] = actual data (many Bytes)

I'm am not sure how to go about reading in the data i get after a psp interrupt. should it be like this

#define portd 8
#define type_buffer = ??
#define data_buffer = ??

during the psp interrupt
if(portd == 0x05)
{
type_buffer = portd;
}
//depending on the type_buffer read the data
//dunno how to read data of more the 1 Byte




*************************
Thank you for any assitance
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 15, 2006 12:32 am     Reply with quote

See the CCS example file EX_PSP.C. It has an example of an #int_psp
interrupt service routine. Look in this folder for the file:

c:\program files\picc\examples
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