Jump to content

McNerdius

EstablishedMember
  • Posts

    18
  • Joined

  • Last visited

About McNerdius

  • Birthday 08/25/1984

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Gender
    Male
  • Location
    Perry, Iowa

McNerdius's Achievements

Newbrie

Newbrie (1/6)

0

Reputation

  1. I'd been having problems with an 18F based project - till i realized it worked via pickit 2 ICD. So i started reading around - and found out that my problem is almost certainly that the debug bit is 0 in CONFIG1L. I can't get this to set via pickit - i've tried various methods. Its probably got to do with the fact that the config's are loaded differently on these parts than some others. Anyhoo, the questions are - 1) I see a drop-down menu with one option in it: "DEBUG" I can only assume this is a build-option... Clearly i am trying to do a Release build, not a debug... yet i can't find any mention of this dropdown in the manuals, and after 45+ minutes of googling and searching the forums, i can't figure out any way of changing from debug to release... 2) (Some lines trimmed): Building... "C:\Program Files\SourceBoost\boostc_pic18.exe" app.c -t PIC18F26J11 -idx 1 -obj Debug -d _DEBUG BoostC Optimizing C Compiler Version 7.03 (for PIC18 architecture) Single user Lite License (Unregistered) for 0 node(s) app.c success "C:\Program Files\SourceBoost\boostlink_pic.exe" -idx 1 /ld "C:\Program Files\SourceBoost\lib" libc.pic18.lib Debug\app.obj /t PIC18F26J11 /d "Debug" /p app BoostLink Optimizing Linker Version 7.03 Building CASM file Memory Usage Report =================== RAM available:3776 bytes, used:2 bytes (0.1%), free:3774 bytes (99.9%), Heap size:510 bytes, Heap max single alloc:127 bytes ROM available:65528 bytes, used:76 bytes (0.2%), free:65452 bytes (99.8%) success Done OK so there are several "debug" command-line options in there. The question is - how did they get there ? I can't find any way of changing from debug to release or what have you, i don't have any "extra" compiler or linker options defined - nor can i find any information regarding this topic after quite a while of googling, menu-searching, or manual-reading. Lastly - is this quest for a "Release" option going to do me any good ? After all, i'm only looking to set my debug bit in CONFIG1L - which i can do right now by tweaking my TDF file. But if there is a "proper" intended way of doing this, i'd like to think i'm just missing it...
  2. Yep. Good news too... well, news anyway. It works via debug mode. I'd personally never used debug on anything, so it took a bit of fiddling to figure it out this evening, but sure enough - things run nicely via debug. As i'm not familiar with In-Circuit-Debugging, i can only make guesses as to what this means about my project. The one and only thing that comes to mind is clocking. My configuration bits and osccon are correct, therefore i assume my problem is the aluminum electrolytic capacitor i am using for vddcore. Then again... That's just an uneducated guess.
  3. Pics of hardware attached. I had been assembling it on a SBB, then said screw it and put it on a perfboard. I'm hoping at this point all that i need to do is use a higher-quality capacitor. It's always something stupid.
  4. void main() { osccon = 0b01101100; ancon0 = 255; ancon1 = 0b00011111; //disable analog crapola trisa = 0; porta = 0; trisb = 0; portb = 0; latc = 0; trisc = 0; portc = 0; while (true) { portc=255;//latc=255; delay_ms(1); portc=0;//latc=0; delay_ms(1); } } It's all there in my post man. you'll note that i set bit six of adcon1 as 0, just as page 353 of the manual instructs. I've read the manual, and as a side note - the topic of my post is "Newbie to 18F failing to flash Led." I know it's common for newbies to post expecting a solution without having googled, read the manual, or experimented. That's not the case here. If the code i posted in my original post looks flawed, let me know.
  5. Will do on the XINST (when i get home). I meant for that to be a delay_s(1) ... odd... my fingers are betraying me. However, i've recently changed the loop to: while (true) { latc = 255; } still no luck.
  6. OK OK i feel like an idiot. I'm putting this here because it's so incredibly common when learning the ins and outs of a new product family to COMPLETELY AND TOTALLY miss something. I've googled to no avail in regards to some bits of code out there... I'm new to this family and have done very little with 18Fs in general. All i'm doing at this point is trying to flash an LED on portc - just to get my feet wet. Here is what i have (sorry it's so darn long... i'm including it ALL) #include <system.h> ////////////////////////////////////////////////////////////////// // Watchdog Timer: #pragma config WDTEN = OFF // Disabled - Controlled by SWDTEN bit ////////////////////////////////////////////////////////////////// // Stack Overflow/Underflow Reset : #pragma config STVREN = ON // Enabled ////////////////////////////////////////////////////////////////// // Extended Instruction Set: #pragma config XINST = ON // Enabled ////////////////////////////////////////////////////////////////// // Code Protect: #pragma config CP0 = OFF // Program memory is not code-protected ////////////////////////////////////////////////////////////////// // Oscillator: #pragma config OSC = INTOSC // INTOSC ////////////////////////////////////////////////////////////////// // T1OSCEN Enforcement: #pragma config T1DIG = ON // Secondary Oscillator clock source may be selected ////////////////////////////////////////////////////////////////// // Low-Power Timer1 Oscillator: #pragma config LPT1OSC = ON // Low-power operation ////////////////////////////////////////////////////////////////// // Fail-Safe Clock Monitor: #pragma config FCMEN = ON // Enabled ////////////////////////////////////////////////////////////////// // Internal External Oscillator Switch Over Mode: #pragma config IESO = OFF // Disabled ////////////////////////////////////////////////////////////////// // Watchdog Postscaler: #pragma config WDTPS = 1 // 1:1 ////////////////////////////////////////////////////////////////// // DSWDT Clock Select: #pragma config DSWDTOSC = INTOSCREF // DSWDT uses INTRC ////////////////////////////////////////////////////////////////// // RTCC Clock Select : #pragma config RTCOSC = INTOSCREF // RTCC uses INTRC ////////////////////////////////////////////////////////////////// // Deep Sleep BOR : #pragma config DSBOREN = OFF // Disabled ////////////////////////////////////////////////////////////////// // Deep Sleep Watchdog Timer: #pragma config DSWDTEN = OFF // Disabled ////////////////////////////////////////////////////////////////// // Deep Sleep Watchdog Postscaler: #pragma config DSWDTPS = 2 // 1:2 (2.1 ms) ////////////////////////////////////////////////////////////////// // IOLOCK One-Way Set Enable bit: #pragma config IOL1WAY = OFF // The IOLOCK bit (PPSCON<0>) can be set and cleared as needed ////////////////////////////////////////////////////////////////// // MSSP address masking: #pragma config MSSP7B_EN = MSK7 // 7 Bit address masking mode ////////////////////////////////////////////////////////////////// // Write/Erase Protect Page Start/End Location: #pragma config WPFP = PAGE_63 // Write Protect Program Flash Page 63 ////////////////////////////////////////////////////////////////// // Write/Erase Protect Region Select bit (valid when WPDIS = 0): #pragma config WPEND = PAGE_0 // Page 0 to WPFP<5:0> erase/write-protected ////////////////////////////////////////////////////////////////// // Write/Erase Protect Configuration Region : #pragma config WPCFG = OFF // Configuration Words page not erase/write-protected ////////////////////////////////////////////////////////////////// // Write Protect Disable bit: #pragma config WPDIS = OFF // WPFP[5:0], WPEND, and WPCFG bits ignored void main() { osccon = 0b01101100; ancon0 = 255; ancon1 = 0b00011111; //disable analog crapola trisa = 0; porta = 0; trisb = 0; portb = 0; latc = 0; trisc = 0; portc = 0; while (true) { portc=255;//latc=255; delay_ms(1); portc=0;//latc=0; delay_ms(1); } } as you can see, i've set my tris values, my oscillator setup should be ok, i've disabled analog, disabled WDT, and everything else i've ever needed to do and everything i need to do as i understand it. NO WORKY. If anyone can be so kind as to give it a quick look-see and maybe even tell me what this LATC/LATB/etc stuff is (i mean, in practical language, not manual-speak) i would much appreciate it ! Thanks.
×
×
  • Create New...