PICcoder.co.uk Forum  


::post new topic::
<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>
Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/04/04 03:09 By: jon Status: Visitor  
 
have anyone successfully converted the code for a P18F2450,

i cahnged the device selection, configuration bits, lkr file, io_cfg.h but still the PC cant seem to detect the PIC...
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/04/05 03:22 By: Jon Status: Visitor  
 
Can someone help, Please i have no idea y this is not working, since its almost the same thing, i am trying to use this code on a PIC18F2450 and this is what i did so far,

First I change the linker files to this

LIBPATH .

FILES c018i.o
FILES clib.lib
FILES p18f2450.lib

CODEPAGE NAME=boot START=0x0 END=0x7FF
CODEPAGE NAME=vectors START=0x800 END=0x829 PROTECTED
CODEPAGE NAME=page START=0x82A END=0x3FFF
CODEPAGE NAME=idlocs START=0x200000 END=0x200007 PROTECTED
CODEPAGE NAME=config START=0x300000 END=0x30000D PROTECTED
CODEPAGE NAME=devid START=0x3FFFFE END=0x3FFFFF PROTECTED

ACCESSBANK NAME=accessram START=0x0 END=0x5F
DATABANK NAME=gpr0 START=0x60 END=0xFF
DATABANK NAME=gpr1 START=0x100 END=0x1FF
DATABANK NAME=usb4 START=0x400 END=0x4FF PROTECTED
ACCESSBANK NAME=accesssfr START=0xF60 END=0xFFF PROTECTED

SECTION NAME=CONFIG ROM=config

STACK SIZE=0x100 RAM=gpr1


then i change the IO_Cfg.c, all portD to A, the bits tat i've changed is as below

#define tris_usb_bus_sense TRISAbits.TRISA1 // Input
#define usb_bus_sense PORTAbits.RA1

#define tris_self_power TRISAbits.TRISA0 // Input
#define self_power PORTAbits.RA0

#define mInitAllLEDs() LATA &= 0xC3; TRISA &= 0xC3;
#define mLED_1 LATAbits.LATA2
#define mLED_2 LATAbits.LATA3
#define mLED_3 LATAbits.LATA4
#define mLED_4 LATAbits.LATA5


I also change the device selection to P18F2450 and the configuration bits to

reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/04/05 03:27 By: Jon Status: Visitor  
 
Ok, i solved it, the core of the program is using polling thus ut must be fast enough, and a 8Mhz xtal that i'm using is not fast enough so i pump it thru the PLL and use that as the system clock
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/04/06 10:16 By: dariog Status: User  
Karma: 6  
Posts: 107
graphgraph
Hmmm, actually I don't think that your problem could have been the "speed of software which is doing polling" but it may be.
Sure, CONFIG bits in USB application often do create troubles especially at beginning.

An advice: do use CONFIG #pragmas inside your code, rather than applying CONFIG into MPLAB ... it makes life easier.
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/04/19 22:45 By: Capn Status: User  
Karma: 0  
Posts: 1
graphgraph
I am working on a project involving transferring data from a PIC18F4550 to a PC via USB. My board has been set up exactly as the schematic describes (including RA1) and I've done every little tweak I could find while poring over the forums.

So here's the problem:

Upon power-up (plugging in the USB cable), the two lights flash for a little, the "USB Device Not Recognized" message appears, and the board goes into Suspend mode (denoted by simultaneous flashing of LEDs, right?). I've tried to force Windows to install the mchpusb.inf driver, but it tells me "The specified location does not contain information about your hardware." Secondly, the device doesn't seem totally stable; meaning it disappears briefly from the device manager then reappears.

Device Info:
I have a 20MHz external oscillator, so settings are as follows:
Full Speed USB CLock Source Selection: Clock src from 96MHz PLL/2
CPU System Clock Postscaler: [OSC1/OSC2 Src: /1][96MHz PLL Src: /2]
96MHz PLL Prescaler: Divide by 5 (20MHz input)

I'm using Microchip's PICkit 2 programmer (is that going to change how I configure my bits?)

My D+ and D- wires are about 3cm long and wrapped in an anti-static shield, just in case.


Anyhoo, I appreciate any advice you can give me.

Post edited by: Capn, at: 2007/04/19 23:46

Post edited by: Capn, at: 2007/04/20 01:26
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/05/01 14:28 By: dariog Status: User  
Karma: 6  
Posts: 107
graphgraph
Can only try helping, posting my (working) CONFIG:

Code:

 #pragma config WDT = ON, WDTPS = 1024, MCLRE=ON, STVREN=ON, LVP=OFF #pragma config PLLDIV=5, CPUDIV=OSC1_PLL2, USBDIV=2, FOSC=HSPLL_HS, IESO=OFF, PWRT=OFF, BOR=ON,  BORV=2 #ifndef __EXTENDED18__ #pragma config VREGEN=ON, LPT1OSC=OFF, PBADEN=OFF, CCP2MX=ON, XINST=OFF, DEBUG=OFF #else #pragma config VREGEN=ON, LPT1OSC=OFF, PBADEN=OFF, CCP2MX=ON, XINST=ON, DEBUG=OFF #endif



HTH
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/06/26 09:47 By: duchungjava Status: Visitor  
 
This is the best article I have ever read.
Thanks Mat so much.
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/08/08 09:41 By: Axel Status: Visitor  
 
Hi

I try to use this project for making my first PIC USB project and I have some issues:

- First I don't really understand why I need to add the resistor on RA1?
- Everything work well on XP computer but on my VISTA laptop the pic answer just one time and after I have to reset the PIC board. Is it coming from the pic software or the C# software?.
- I don't know why I cant use my IDC2 in debug mode with this project? I have change in MPLAB the configuration bit for enable it but it doesn’t work.

I am using exactly the same software and hardware given on the article.

Thanks for your help

sorry for my English, I am french
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/08/08 11:19 By: Axel Status: Visitor  
 
I tried to find the configuration bit in the code but I can'find it!
Did someone know where itis?
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/08/08 12:13 By: Axel Status: Visitor  
 
My debuger issue is fixed
I just need help for VISTA now
reply | quote

Re:Basic USB - Using Microchip Stack and C#.Net
Date: 2007/08/09 21:27 By: Axel Status: Visitor  
 
Hi
every thing work very well on XP for me, now if someone have fixed the issue of vista live me a message.
reply | quote

<< Start < Prev 1 2 3 4 5 6 7 8 9 10 Next > End >>
::post new topic::