PIC18F2550 and USB problem!!!

General discussion on mikroBasic.
Post Reply
Author
Message
angelpic
Posts: 91
Joined: 07 May 2006 12:48

PIC18F2550 and USB problem!!!

#1 Post by angelpic » 07 May 2006 14:58

Hi, when i compile the "HID_TEST" example and put code in the PIC18F2550 with a 12Mhz resonator (i have changed PLLDIV to 3) is all ok.
When i add in the code LCD routines:

LCD_Init(PORTB)

the PC give me "Unknow USB ..." , Why? Thanx.

xor
Posts: 5465
Joined: 18 May 2005 00:59
Location: NYC
Contact:

#2 Post by xor » 07 May 2006 15:19

I believe that the USB freq divisions need to land on 24MHz or 48MHz. You must also enter this result frequency (using PLL) as your Project Editor Clock value so that other timed functions can be managed correctly.
[color=darkred][b]xor[/b][/color]
[url=http://circuit-ed.com]CircuitED -[/url]

angelpic
Posts: 91
Joined: 07 May 2006 12:48

#3 Post by angelpic » 07 May 2006 15:54

Please can you send me an example of configuration for a PIC18F2550 with 12 or 20 or 4 Mhz resonator? Which of this resonator is the best for me? Thanx

xor
Posts: 5465
Joined: 18 May 2005 00:59
Location: NYC
Contact:

#4 Post by xor » 07 May 2006 16:24

I've successfully used the HID example for the 18F2550 in the mBASIC examples folder. Load up the project and check the configs in the Project Editor. This works with an 8MHz oscillator.
[color=darkred][b]xor[/b][/color]
[url=http://circuit-ed.com]CircuitED -[/url]

angelpic
Posts: 91
Joined: 07 May 2006 12:48

#5 Post by angelpic » 07 May 2006 16:42

I've tried with an 8MHz oscillator and with Mikrobasic 18f2550 HID example but when i write:

...
Init_Main
LCD_Init(PORTB)
...

The sample not work :cry:

xor
Posts: 5465
Joined: 18 May 2005 00:59
Location: NYC
Contact:

#6 Post by xor » 07 May 2006 17:00

What's not working? The example compiles fine by adding LCD_INT():

Code: Select all

main:
  df=0
  Init_Main
  LCD_INIT(PORTB)
  HID_Enable(@userRD_buffer, @userWR_buffer)
  Delay_mS(1000)
  Delay_mS(1000)
     '
     '  rest of example code
     '
end.
[color=darkred][b]xor[/b][/color]
[url=http://circuit-ed.com]CircuitED -[/url]

angelpic
Posts: 91
Joined: 07 May 2006 12:48

#7 Post by angelpic » 07 May 2006 17:03

The PC give me message:

"Unknow USB ..."

While if i don't use LCD_INIT(PORTB) the PC know the chip as HID Human Interface.

xor
Posts: 5465
Joined: 18 May 2005 00:59
Location: NYC
Contact:

#8 Post by xor » 07 May 2006 18:17

I stuck my '2550 into my board with the USB_HID program, including the LCD_INIT(), and it shows and works with the HID Terminal program in mBASIC Tools. I'm using mB V4.03.

Are you using a development board? If using the EasyPIC3, be sure your USB jumpers JP7, JP8, and JP9, are set to the right-hand position.
[color=darkred][b]xor[/b][/color]
[url=http://circuit-ed.com]CircuitED -[/url]

angelpic
Posts: 91
Joined: 07 May 2006 12:48

#9 Post by angelpic » 08 May 2006 10:53

Ok, thanx. The problem is in the Mikrobasic version. With 4.03 work fine :D

Jean_Carlod
Posts: 2
Joined: 09 Mar 2016 21:45

Re: PIC18F2550 and USB problem!!!

#10 Post by Jean_Carlod » 09 Mar 2016 21:58

Hi!
I'm an inconsistency in the configuration programming routine LCD. The error appears in red. Will you help me? :?

Follow the following program:

void config()
{
OSCCON=0b11101110; //programa a freq. interna para 4MH//
LCD_INIT(&PORTB); //Configuração do LCD//
Lcd_Cmd(_LCD_CURSOR_OFF);
TRISC=0b10000000;

INTCON2.f7=0; //configura as resist. de pull up//
TRISB=0b00000011;
escreve_apagando_LCD(1,6,"Hello!");
PORTC=0;
PORTC.f0=1;

ADCON1=0b00001101; //seleciona porta AN0 AN1
TRISA=0b00000011;

max_f=0.0;
media=0.0;
teste_valido=0;

Delay_ms(200); //alterado//
escreve_apagando_LCD(2,9,"Menu-->"); //Mensagem de introdução//
LCD_OUT(1,3,"HandGrip FATEC");

}

User avatar
biljana.nedeljkovic
mikroElektronika team
Posts: 1043
Joined: 30 Jun 2015 15:15

Re: PIC18F2550 and USB problem!!!

#11 Post by biljana.nedeljkovic » 10 Mar 2016 14:36

Hello,

I believe I had answered you here:
http://forum.mikroe.com/viewtopic.php?f=13&t=67193

Kind regards,
Biljana

Post Reply

Return to “mikroBasic General”