Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About McNerdius

  • Rank
  • Birthday 08/25/1984

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Gender
  • Location
    Perry, Iowa
  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
  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 th
  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 Ti
  7. YAY IM AN IDIOT #pragma DATA _CONFIG4L,11000000b //mmm... check this one that was the problem. i had the "Extended Instruction Set" Enabled.... And after r-ing tfm... Enabling the PIC18 extended instruction set (XINST Configuration bit = 1) significantly changes certain aspects of data memory and its addressing. sounds familiar... Man... i feel dumb. i mean... that comment was there since the day i started putting this app together.
  8. Ok... Here's what i've figured out so far. It's got NOTHING to do with serial. How do i know ? The following is the entirety of my code right now... #include <system.h> #pragma DATA _CONFIG1L, 00111100b #pragma DATA _CONFIG1H, 00001110b #pragma DATA _CONFIG2L,00111000b #pragma DATA _CONFIG2H,0 //disable WDT #pragma DATA _CONFIG3H,0 #pragma DATA _CONFIG4L,11000000b //mmm... check this one #pragma CLOCK_FREQ 16000000 void main() { trisa=0; char idx=0; char booger[9] = {1,2,3,4,5,6,7,8,9}; while (true) { porta=booger[idx];
  9. I've got an odd problem which i've whittled down to the following applicable code: #include <uhw4450.h> #include <system.h> #include <miniuhw.h> #include <sLCD.h> #pragma DATA _CONFIG1L, 00111100b #pragma DATA _CONFIG1H, 00001110b #pragma DATA _CONFIG2L,00111000b #pragma DATA _CONFIG2H,0 //disable WDT #pragma DATA _CONFIG3H,0 #pragma DATA _CONFIG4L,11000000b //mmm... check this one #pragma CLOCK_FREQ 16000000 void main() { uart_init(1,103); //9600@16mhz // delay_s(2); trisa=0; // putc('\r'); putc('\n'); // putc('T'); pu
  10. got it sorted. forgot that start bits are 0. duh. so on the transmit side, PIC was trying to send a start bit, which will not illuminate the LED. on the receive side, i was pulling Rx pin low. always getting a start bit, never getting data. pull the Rx pin high, and BAM... we're in action. That and i tweaked my code a bit so on the Rx side of things, i'm always checking for data more often than the Tx side is spitting it out. Handy dandy. *moves on to next project*
  11. #pragma DATA _CONFIG, _XT_OSC & _WDT_OFF & _CP_OFF & _PWRTE_OFF this sets up an external oscillator. If that's not your intent, replace _XT_OSC with _INTOSCIO (for the 616) and you should be good to go. Note that i haven't looked at the code or anything the manual for the 616 is right here (if you don't already have it): http://ww1.microchip.com/downloads/en/DeviceDoc/41288A.pdf they are awesome.
  12. All that being said, i will add on that creating a simple "write" function like this: void write() { char d=0; for(;;d++) { putc(d); if (d==255) d=0; delay_s(1); } } does nothing for me right now. I hook up an LED to tx, and it does not flash.
  13. BoostC 6.91, 16F690, 8MHZ, etc... I'm going to try and set this up using the hardware, which i've avoided since i've read that setting it up for a eusart is fairly different. And that's moot, i should be able to get this to work using software . Ok, here's the code: // **** START OF DEFAULTS USED FOR SOFTWARE USART EMULATION **** unsigned short sw_SPBRG@0x47; // define location for the emulated SSPCON1 unsigned short sw_RCREG@0x48; // define location for the emulated SSPCON2 unsigned short sw_TXREG@0x49; // define location for the emulated SSPSTAT unsigned short sw_TXSTA@0x4A; // d
  14. This is not really about porting so much as learning the ins and outs of BoostC. I'm used to CCS's free-PCB, in which if you say something like: PORTB=6; *PORTB=128; your code will work like a gem and whatnot. I don't mind the volatile char portb@6; way of doing things for ports....... BUUUUUUUT. i'm looking for a way to represent a pin as a byte, the likes of PORTB*8+5; that is to say, it is the 53rd bit. if nothing else one can break this down into it's port/pin "meaning", for instance: char pimp[]={PORTB*8+5,PORTC*8+3}; char port = (pimp[0]/8); char pin = (pimp[0]%8
  15. yeah, LEDs on all pins. the ASM is fine... the c isnt. i forgot anselh=0; i'm an idiot. well no im not. im porting code when i should be sleeping, that's what i am. the 610 doesnt have anselh. i should've figured this out before, i've actually done this once already, but the symptoms were different. i was adding some features to a 610 project, upgrading it to a 690. the new features were on c6 and 7 which were not acting properly. WHY !?!?!? c6 is an8 c7 is an9 both are on anselh. i am learning. lol. THANK YOU.
  • Create New...