It is currently 15 Oct 2018 20:48

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 16 Jul 2017 04:44 
Offline

Joined: 04 May 2012 10:52
Posts: 34
Location: Canada
Hi,
I have a problem with USB_CDC_Demo_NA from Dany's PIC projects site. After successful compilation my Windows 10 does not want to recognize the USB_CDC device - Device Descriptor Request Failed.
Tried to replace original usbser.sys and usbser.inf with files from Dany's site with no luck. I did not change VID and PID in the USB_ProjectItems.mpas file.

I am using:
PIC18F4550
20 MHz crystal
EasyPIC 7 board

Could you guys point me what I am doing wrong?

Thanks in advance!


Attachments:
USB_problem2.JPG
USB_problem2.JPG [ 30.64 KiB | Viewed 836 times ]
USB_problem1.JPG
USB_problem1.JPG [ 36.64 KiB | Viewed 836 times ]
Top
 Profile  
 
PostPosted: 18 Jul 2017 08:51 
Offline
mikroElektronika team
User avatar

Joined: 02 Feb 2017 14:21
Posts: 780
Hi,

The frequency required for the usb to work properly is 48MHz.
Change your clock accordingly and your micro controller will recognize without problems.

Best Regards,

_________________
Dusan Poluga.


Top
 Profile  
 
PostPosted: 18 Jul 2017 15:46 
Offline

Joined: 04 May 2012 10:52
Posts: 34
Location: Canada
Hi Dusan,

Quote:
The frequency required for the usb to work properly is 48MHz.

Do you mean 48 MHz crystal should be used?

Dany,

My project cfg file attached.

Thanks,
Vlad


Attachments:
USB_CDC_cfg.rar [335 Bytes]
Downloaded 27 times
Top
 Profile  
 
PostPosted: 18 Jul 2017 23:51 
Offline

Joined: 04 May 2012 10:52
Posts: 34
Location: Canada
Dany,

There is the USB_CDC_OA source code compilation - "BitUtils.mpas" not found.


Attachments:
OA.JPG
OA.JPG [ 159.18 KiB | Viewed 809 times ]
Top
 Profile  
 
PostPosted: 19 Jul 2017 14:13 
Offline

Joined: 18 Jun 2008 11:43
Posts: 3764
Location: Nieuwpoort, Belgium
VladimirG wrote:
Hi Dusan,
Quote:
The frequency required for the usb to work properly is 48MHz.

Do you mean 48 MHz crystal should be used?

Hi Vladimir,

If you use a 20 Mhz crystal as you say, then the configuration settings for your project should be chosen as stated on the right hand side of the figure below:
Attachment:
Capture19-07-2017-14.30.01.jpg
Capture19-07-2017-14.30.01.jpg [ 189.71 KiB | Viewed 805 times ]

Additionally you should set the CPU speed in your project to 48 Mhz (see figure above, the signal path is drawn in red).

To make it complete you should add following init code in your project:
OSCCON := (OSCCON and (not 112)) or 64; // 1 Mhz (default)
OSCTUNE := (OSCTUNE and (not 128)); // 31 Khz from INTRC source (default)
OSCCON := (OSCCON and (not 3)); // Primary clock (default)
UCFG := (UCFG and (not 4)) or 4; // FSEN = 1
T1CON := (T1CON and (not 8)); // Disable Timer1 (secondary) oscillator (default)
You can leave out the 'default' settings if you want.

_________________
Kind regards, Dany.
There is a crack in everything, that's how the light gets in... (L. Cohen)


Top
 Profile  
 
PostPosted: 20 Jul 2017 03:28 
Offline

Joined: 04 May 2012 10:52
Posts: 34
Location: Canada
Hi Dany,

Problem is solved for both OA and NA packages. The trouble was with the MikroProg Suite settings. When I hit Ctrl+F11 (Build and Program) the MikroProg comes up with incorrect configuration bits settings (USB clock selection, PLL Prescaler). Project setting has to be changed.

Thanks a lot!


Top
 Profile  
 
PostPosted: 21 Jul 2017 10:41 
Offline
mikroElektronika team
User avatar

Joined: 02 Feb 2017 14:21
Posts: 780
Hi,

I am glad that you have solved it Vladimir.
Thank you Dany for giving a detailed explanation.

Best Regards,

_________________
Dusan Poluga.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to: