![]() |
![]() |
![]() |
|
|
|||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
I have a PIC18F2620 with port b connected as shown in http://imagebin.ca/view/4YjqO0.html (except on pin 1, it has a 10k pullup resistor to 5V rather than the power on reset circuit shown in the link). I'm currently using sdcc to compile my code and flashing the hex file to the microcontroller using a PICKIT2 programmer from Microchip through pk2 command line software in Kubuntu. The reason that I'm doing so this way is b/c I'm encountering problems with Microchip's PICKIT2 software in Windows. Basically, I'm using an internal oscillator in mode 2 at 8 MHz. I've talked to people on Usenet newsgroups, Microchip forums, dutchforce forums, and sdcc mailing list about the problem. While I'm very close on solving the fusebit initialization problems, I am still encountering the problem of not being able to have the microcontroller start the execution of the control code automatically whenever an external power supply other than the computer was applied to the microcontroller, although I've checked with an oscilloscope that it appears to be fairly stable. Does anyone here have any insights on this? I would be happy to provide more information if needed as I'm trying my luck here on another forum.
Thanks! |
|
|
|
|
|
|
(permalink) |
|
I just wanted to update on the situation. I have swapped the PIC18F2620 with a PIC18F2220 and changed some code and the self-execution problem appears to be solved for now.
|
|
|
|
|
|
|
(permalink) |
|
What "self-execution" does actually mean?
__________________
Agustín Tomás In theory, there is no difference between theory and practice. In practice, however, there is. |
|
|
|
|
|
|
(permalink) |
|
Perhaps I phrased things pretty badly. What I meant by "self-execution" is my code being able to run automatically when I apply an external power source to the microcontroller. Hope it helps clear the confusion.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
Don't really think it's a power supply problem, b/c if it is, I shouldn't be able to get it working with a microcontroller of a different model. It's probably something wrong with that microcontroller itself or something wrong in the code that I flashed to it.
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
Are you asking about the fusebits or power supply?
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
Power supply: 15V ac adapter that I scrapped off from a malfunctioning wireless router, regulated using a 7805 regulator with 22 uF (input) and 10 uF + 0.1 uF (output) caps in parallel
Fusebits: have to look at it when I get home from work; don't have the code in front of me |
|
|
|
|
|
|
(permalink) |
|
Which fusebit details would you like to know?
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
These are my fusebits command lines in the source code using PIC18F2620:
Code:
#pragma stack 0x200 0xff code char at __CONFIG1H _conf0 = _OSC_INTIO7_1H; code char at __CONFIG2L _conf1 = _BOREN_OFF_2L; code char at __CONFIG2H _conf2 = _WDT_DISABLED_CONTROLLED_2H; code char at __CONFIG3H _conf3 = _MCLRE_MCLR_OFF_RE3_ON_3H; code char at __CONFIG4L _conf4 = _LVP_OFF_4L; code char at __CONFIG5L _conf5 = _CP_0_OFF_5L & _CP_1_OFF_5L; code char at __CONFIG5H _conf6 = _CPD_OFF_5H & _CPB_OFF_5H; code char at __CONFIG6L _conf7 = _WRT_0_OFF_6L & _WRT_1_OFF_6L; code char at __CONFIG6H _conf8 = _WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H; code char at __CONFIG7L _conf9 = _EBTR_0_OFF_7L & _EBTR_1_OFF_7L; code char at __CONFIG7H _conf10 = _EBTRB_OFF_7H; Code:
#pragma stack 0x100 0xff code char at __CONFIG1H _conf0 = _OSC_INT_CLKOUT_on_RA6_Port_on_RA7_1H; //_OSC_INTIO7_1H; code char at __CONFIG2L _conf1 = _PUT_ON_2L & _BODEN_OFF_2L; //_BOREN_OFF_2L; code char at __CONFIG2H _conf2 = _WDT_DISABLED_CONTROLLED_2H; code char at __CONFIG3H _conf3 = _MCLRE_MCLR_Disabled_RE3_Enabled_3H; //_MCLRE_MCLR_OFF_RE3_ON_3H; code char at __CONFIG4L _conf4 = _LVP_OFF_4L; code char at __CONFIG5L _conf5 = _CP_0_OFF_5L & _CP_1_OFF_5L; code char at __CONFIG5H _conf6 = _CPD_OFF_5H & _CPB_OFF_5H; code char at __CONFIG6L _conf7 = _WRT_0_OFF_6L & _WRT_1_OFF_6L; code char at __CONFIG6H _conf8 = _WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H; code char at __CONFIG7L _conf9 = _EBTR_0_OFF_7L & _EBTR_1_OFF_7L; code char at __CONFIG7H _conf10 = _EBTRB_OFF_7H; |
|
|
|
|
|
|
(permalink) |
|
I'm also trying a 8.0 Mhz and 32.764 kHz crystal oscillators at the same time since I may need to use 2620's memory capacity for what I want to do.
|
|
|
|
|
|
|
(permalink) |
|
I have tried to manually reprogram the configuration bits in pk2 on the 2620. I have taken a shortcut on figuring out the fusebits by looking in the .h files that I've posted on this thread. Below shows the printout indicating that I have failed to configured the fusebits.
Code:
root@prak-laptop:/media/sdb1/Sysil Laboratories/software_projects/LED_toggle# pk2 -config 0x3000 0xfef8 0xff00 0x00fb 0xffff 0xffff 0xffff PK2 version 2.04 - 2006/12/17 pk2 -config 0x3000 0xfef8 0xff00 0x00fb 0xffff 0xffff 0xffff Locating USB Microchip PICkit2 (vendor 0x04d8/product 0x0033) Found USB PICkit as device '003' on USB bus 003 Communication established. PICkit2 firmware version is 1.21.0 Device ID 0x0c80 PIC18F2620 Rev 6 found Writing config words root@prak-laptop:/media/sdb1/Sysil Laboratories/software_projects/LED_toggle# pk2 -config PK2 version 2.04 - 2006/12/17 pk2 -config Locating USB Microchip PICkit2 (vendor 0x04d8/product 0x0033) Found USB PICkit as device '003' on USB bus 003 Communication established. PICkit2 firmware version is 1.21.0 Device ID 0x0c80 PIC18F2620 Rev 6 found User ID: 0xffff 0xffff 0xffff 0xffff Configuration data: 0x0000 0x1e18 0x8700 0x00c1 0xc00f 0xe00f 0x400f Thanks. |
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Accessing EEPROM | Clayton | Micro Controllers | 15 | 23rd March 2007 03:00 AM |
| Need PIC16F84A Cool Project | Agent 009 | Micro Controllers | 158 | 11th March 2007 06:14 AM |
| Motor control interface | dreamproject | Micro Controllers | 0 | 31st March 2005 03:48 AM |
| PIC16F84A Code Protect | gatas | Micro Controllers | 3 | 21st July 2003 02:44 PM |
| Remote control code grabber | nonzero | Electronic Projects Design/Ideas/Reviews | 5 | 20th July 2003 04:01 PM |