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

PCD: - PIC24 - USB error

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







PCD: - PIC24 - USB error
PostPosted: Tue Dec 08, 2009 12:32 pm     Reply with quote

I set the pull up on the DPPULUP.
When I plug the PC USB cable to my terminal I get "found new hw wizard" and the installation is started. But on the end of the installation process I get this:
Quote:

The installation failed because a function driver was not specified for this device instance.

?

Strange is that if I put real hw resistor then everything is working fine.

This is the code:
Code:

#word U1OTGCON = 0x0486   
#bit OTGEN = U1OTGCON.2   
#bit DPPULUP = U1OTGCON.7  // pull ups on USB

********
void main()
{
usb_init_cs();
OTGEN = 1;       
DPPULUP = 1; 

 usb_task();
      usb_debug_task();
      if (usb_enumerated())
      {
         if (!send_timer)
         {
            send_timer=250;
            out_data[0]=read_adc();
            out_data[1]= 1; //BUTTON_PRESSED();
            if (usb_put_packet(1, out_data, 2, USB_DTS_TOGGLE));
         }
         if (usb_kbhit(1))
         {
            usb_get_packet(1, in_data, 2);
         }
      }
} // main
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Dec 08, 2009 4:04 pm     Reply with quote

This is probably a Microchip issue. Go to the Microchip forum search page:
http://www.microchip.com/forums/search.aspx
(Bookmark this page). Put the following in the search box:
Quote:
DPPULUP

Press Enter and you'll get one hit that discusses the problem.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Dec 09, 2009 5:18 am     Reply with quote

I could operate the CCS HID example with PIC24 on Explorer 16 board and USB PICtail without modification, I didn't care for the involved hardware details, but as far as I understand, there are no external resistors present in this configuration.
PaxMax
Guest







PostPosted: Sat Dec 12, 2009 7:31 am     Reply with quote

I made tests on WIN2000 and on WIN XP.
In both cases i get the same error.

After that i solder the pull down resistor and make the test again.
The same thing.

I'm testing this on my own terminal and i have made the tests with almost all ccs examples, regarding USB.

If i put SW resistor or HW resistor i get the same error ??
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Dec 12, 2009 7:47 am     Reply with quote

If I understand right, then you are reporting a different behaviour than in your original post, which was about differences with using a hardware resistor?

Your above code example is incomplete. It doesn't contain the #include statements for CCS USB drivers. It's actually unclear, which USB class you're using. I assumed HID, but it's not mentioned anywhere. It's also unclear if you applied any changes to the default USB descriptors.
PaxMax
Guest







PostPosted: Sat Dec 12, 2009 7:47 am     Reply with quote

On the microchip site i found this:

Pull-downs are only active in Host Mode. Therefore to activate the pull-downs you need only to enable the following:

U1PWRCbits.USBPWR = 1;
U1CONbits.HOSTEN = 1;

Then you can control the pull-downs as required:

U1OTGCONbits.DPPULDWN = 1;
U1OTGCONbits.DPPULDWN = 0;

?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Dec 12, 2009 7:52 am     Reply with quote

Confusion is rising. A USB device doesn't use any pulldown resistors. It must assert a pullup at D+ to signal full speed
mode. Normally, this is done internally with all Microchip USB parts. As reported, CCS PIC24 USB examples also utilize this
internal pullup. The respective setting is in the driver code, you don't have to care for it.
PaxMax
Guest







PostPosted: Sat Dec 12, 2009 9:00 am     Reply with quote

Let's take the ex_serial.c sample as test example.
My target is the same PIC24

I test this example on PCB boards with and without external resistor.
I didn't change any SW settings.

If i get this wright, with external resistor this example should work.
But it doesn't.

HW wizard is loaded but he can not complete the driver installation.
I found on the google that this" function driver" is common mistake in some win2000 O.S but i test it on XP / Vista / Win7, and the error is the same.
So it can not be the function driver.

I can make test with or without resistor, just tell me what could be the problem..
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Dec 12, 2009 9:36 am     Reply with quote

For usb_serial (CDC protocol), you have to specify cdc_NTXPVista.inf when installing the device. Did you?
PaxMax
Guest







PostPosted: Sat Dec 12, 2009 9:59 am     Reply with quote

I copied Cdc_NTXPVista.inf‎ into windows and project directory and the installation was started from project directory.

I rerun the whole project and the situation is the same.
Wizard starts and error message occurs...
PaxMax
Guest







PostPosted: Sat Dec 12, 2009 10:03 am     Reply with quote

Forgot to mention.. am testing the code with software made resistor.
Code:

/*
#word U1OTGCON = 0x0486    // USB on the go reg
#bit OTGEN = U1OTGCON.2    // enable bit for OTG
#bit DPPULUP = U1OTGCON.7  // pull ups on USB
*/

/*
OTGEN = 1;       
DPPULUP = 1; 
*/
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Dec 12, 2009 1:40 pm     Reply with quote

As PaxMax yet neglected to mention in this thread, the problem turned out to be PCD version dependent.

I found, that the USB HID example is working correctly with V4.099 and V4.101, but fails with V4.103. I must confess,
that I haven't expected something like this. But the case clarifies, why it's important to insist on getting full compiler
version information with all posts related to possible compiler problems.

Considering other reported PCD V4.103 bugs, the version seems to be a kind of accident. I missed to download
V4.102, so I can't say anything about the predecessor.
PaxMax
Guest







PostPosted: Sun Dec 13, 2009 8:56 am     Reply with quote

OK. Now that we solved compiler problem, i have one question regarding serial example.

I have bunch of other code that should be executed and the USB part should be started just when i plug the cable.

It's like anything other.
Connect the cable, send/receive data, disconnect cable, run the other code till the USB is connected again.

There is USB connection sense pin but im not using it right now.
I'm using USB test tool - Device Monitor Studio - and i can see that he detects when the terminal is connected and when not.

P.M.
PaxMax
Guest







PostPosted: Sun Dec 13, 2009 9:44 am     Reply with quote

If i write value 2 on location 2 and if i want to read this value, why do i always get the same result. Look's like that there is no memory writing...
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sun Dec 13, 2009 12:18 pm     Reply with quote

"Location 2" of what?
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