i know you wanted to say CMCON for the 16F628![]()
i know you wanted to say CMCON for the 16F628![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Except that the default config settings in the .INC files for these chips are for a 20Mhz crystal, using the PLL to get 48Mhz to both USB and CPU.Originally Posted by skimask
Maybe if you tell the programmer not to write the config settings it might .. stress might, come up with the internal oscillator, but NOT defining the required conditions, and hoping it does what you want, is obviously NOT the right way to do things.
And, while we're on the subject of the "right way to do things" ...
When someone asks a question on the Forum, the "right way" is to attempt to provide an answer.
Pointing them to Section 2.2 of the Manual (Your First Program), is just plain Rude!<hr>
Now, for that "Answering the question" part...
Oh, and let me add here that it's preferable to have actually tested the answers you give.
Pull out the 4550, plug it in a breadboard and make sure you're giving an answer, not more problems for the person to deal with.
In my case it's easy... Just pull out the mister_e 18F4550 USB Demo prototype (minus a few LED's) from
http://www.picbasic.co.uk/forum/showthread.php?p=31405
(Yup, I keep them.)
Which then allows me to present the following post, with great confidence that it'll work. Because I've actually done it.
<br>
DT
Nikos,
If you haven't already, it's best to comment out the default oscillator settings in the 18F4550.inc file in the PBP folder, I'm sure you've done that before with other PIC's ...
Then you can set the options in your main program.
Here's a possibility for blinking an LED on PORTA.1 with a 4550 using the Internal Oscillator @4Mhz and your original code ...Keep in mind that the internal oscillator can't drive the USB module. But you can add a crystal to drive the USB and still run the CPU on Internal. Your choice.Code:'18F4550 with Int OSC Blinky @ __CONFIG _CONFIG1H, _FOSC_INTOSC_XT_1H DEFINE OSC 4 ; CPU runs @ 4 Mhz OSCCON = %01100010 ; 4 Mhz Internal Oscillator ;DEFINE OSC 8 ; CPU runs @ 8 Mhz ;OSCCON = %01110010 ; 8 Mhz Internal Oscillator ADCON1 = $0F ; Disable Analog inputs loop: High PORTA.1 'Turn on LED Pause 500 ' Delay for .5 seconds Low PORTA.1 'Turn off LED Pause 500 ' Delay for .5 seconds Goto loop ' Go back to loop and blink LED forever End
HTH,
DT
Thanks to every one that want to help and share with us a piece of his
(or her) experience.
According to Darrel and his piece of his program, I have a problem.
I used to use Micrcode studio Plus for 16f628.
Now with the 18f4550 I need the MPLAB.So, I download the latest version of it and set it up to me laptop.
I did what the microEngineering Labs says about the :
--The PICBASIC™ and PICBASIC PRO™ Compilers can now be used with Microchip's MPLAB®!--
http://www.melabs.com/support/mplab.htm
After all that I try to compile the 18F4550 with Int OSC Blinky that Darrel post and I get two errors Error[118] look at the attached photo
Please advice
Nikos
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I did the following but nothing...
Please H E L P ME.I DO NOT UNDERSTAND!!!!
Why I have to change thE INC file?Why I never did it with 16f628?
We are talking for the INC file in the pbp folder?
;************************************************* ***************
;* 18F4550.INC *
;* *
;* By : Leonard Zerman, Jeff Schmoyer *
;* Notice : Copyright (c) 2006 microEngineering Labs, Inc. *
;* All Rights Reserved *
;* Date : 06/05/06 *
;* Version : 2.47 *
;* Notes : *
;************************************************* ***************
NOLIST
if def PM_USED
LIST
"Error: PM does not support this device. Use MPASM."
__CONFIG _CONFIG1H, _FOSC_INTOSC_XT_1H <-------- add it
NOLIST
else
LIST
LIST p = 18F4550, r = dec, w = -311, w = -230, f = inhx32
INCLUDE "P18F4550.INC" ; MPASM Header
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H
__CONFIG _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
NOLIST
endif
LIST
EEPROM_START EQU 0F00000h
BLOCK_SIZE EQU 32
Oops, my fault. I should have been more complete with my descriptions.
The .INC file should look like this. The 2 red lines are commented out.
Code:;**************************************************************** ;* 18F4550.INC * ;* * ;* By : Leonard Zerman, Jeff Schmoyer * ;* Notice : Copyright (c) 2004 microEngineering Labs, Inc. * ;* All Rights Reserved * ;* Date : 12/31/04 * ;* Version : 2.46 * ;* Notes : * ;**************************************************************** NOLIST ifdef PM_USED LIST "Error: PM does not support this device. Use MPASM." NOLIST else LIST LIST p = 18F4550, r = dec, w = -311, f = inhx32 INCLUDE "P18F4550.INC" ; MPASM Header errorlevel -230 ; __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L ; __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H __CONFIG _CONFIG3H, _PBADEN_OFF_3H __CONFIG _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L NOLIST endif LIST EEPROM_START EQU 0F00000h BLOCK_SIZE EQU 32
DT
Bookmarks