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 CCS Technical Support

USB 16C745

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



Joined: 02 Jun 2004
Posts: 7
Location: WM

View user's profile Send private message

USB 16C745
PostPosted: Wed Jun 02, 2004 3:48 am     Reply with quote

Hi,
I have tried the ex_usb_hid.c and to be honest I'm about to give up.

The compiler comes up with errors like "Constant out of range" in pic_usb.h on "uep=0x1A0;" where uep is an int8*, but I'm not sure if I'm compiling on the right bit number "Microchip 14 Bit" its the only way it will accept the #include "16c745.h".
Is it because I'm using 16c745 instead of 16c765??

After correcting these problems I have run it and the PC asks for drivers so I'm not sure if there is something on the line that is not right, has anyone tried these descriptors before? should the PC recognise it normally? I can't use any debug as it adds delays on the communication and the PC doesn't like it.

I heard Darren is on top of it but I'm sure if he is around.

If anyone has tried it before and had good results please could you send the *.c and *.h

Many thanks
Ttelmah
Guest







Re: USB 16C745
PostPosted: Wed Jun 02, 2004 4:38 am     Reply with quote

lferrari wrote:
Hi,
I have tried the ex_usb_hid.c and to be honest I'm about to give up.

The compiler comes up with errors like "Constant out of range" in pic_usb.h on "uep=0x1A0;" where uep is an int8*, but I'm not sure if I'm compiling on the right bit number "Microchip 14 Bit" its the only way it will accept the #include "16c745.h".
Is it because I'm using 16c745 instead of 16c765??

After correcting these problems I have run it and the PC asks for drivers so I'm not sure if there is something on the line that is not right, has anyone tried these descriptors before? should the PC recognise it normally? I can't use any debug as it adds delays on the communication and the PC doesn't like it.

I heard Darren is on top of it but I'm sure if he is around.

If anyone has tried it before and had good results please could you send the *.c and *.h

Many thanks

As written, the files compile OK for me. Are you changing anything before starting?. If I just load the ex_usb_hid.c, and compile this, it works. Simply changing the #include statement to select the 16c745, also works. MicroChip 14bit is correct. Defining uep as a pointer to an 8bit value, implies it will hold a 16bit address, so should not complain. What version is your compiler?. There are problems on a lot of the newest releases, and these may be causing your behaviour...).
It sounds as if you either have a problem ith the compiler version, or are doing something wrong in the switch to the 745 from the 765. You say you have fixed these problems, with the compile, but these should not be occurring in the first place, and I suspect your fix, may itself be causing problems...

Best Wishes
Darren Rook



Joined: 06 Sep 2003
Posts: 287
Location: Milwaukee, WI

View user's profile Send private message Send e-mail

PostPosted: Wed Jun 02, 2004 7:55 am     Reply with quote

It sounds like you have 16bit pointers disabled. Since the example has 16bit pointers enabled at the beginning of the file you must have modified the file.
lferrari



Joined: 02 Jun 2004
Posts: 7
Location: WM

View user's profile Send private message

PostPosted: Fri Jun 04, 2004 8:17 am     Reply with quote

Yes! you are right Darren, somehow I have deleted the line that enables 16Bits Evil or Very Mad , so all this work for nothing.
I have tried again and it works ok.

Many thanks Smile

Leo
taujin



Joined: 01 Nov 2004
Posts: 1
Location: Malaysia

View user's profile Send private message Yahoo Messenger

Cannot compile as well
PostPosted: Tue Nov 02, 2004 8:31 am     Reply with quote

Guys, i cannot compile the ex_usb_hid.c as well.

The pic_usb.h pop pop up and show some sort of error: Function defination different from previous defination at the

int8 usb_get_packet(int8 endpoint, int8 * ptr, int8 max) {
int8 * buff = 0x1A1; //BD0OBC - EP0 OUT (in to PIC) byte count
int8 * al=0x100;
int8 len;
int8 i=0;

buff+=endpoint*8; //goto BDxOL
len=*buff;
buff++; //goto BDxAL
al+=*buff;

So when i go back to upper part, i found that:

//following functions standard part of CCS PIC USB driver, and used by usb.c
void usb_init();
int1 usb_put_packet(int endpoint, int * ptr, int len, PID_TOGGLE tgl);
int8 usb_get_packet(int8 endpoint, int8 ptr, int8 max);
void usb_stall_ep(int8 endpoint, int1 direction);
void usb_unstall_ep(int8 endpoint, int1 direction);
int1 usb_endpoint_stalled(int8 endpoint, int1 direction);
void usb_set_address(int8 address);
void usb_set_configured(int config);
void usb_wrongstate();

There is some difference between the:
int8 usb_get_packet(int8 endpoint, int8 ptr, int8 max);

with one have pointer one not. So which should be the correct one?

I'm using version 3.190.

Thanks.
_________________
Best Regards,
taujin
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