Jump to content

Ian Smith

EstablishedMember
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Ian Smith

  • Rank
    Newbrie
  1. I want to do this.... unsigned char ar[8] = { 1,2,3,4,5,6,7,8 }; unsigned char index = 5; unsigned char nbit = 3; ar[index].nbit = 1; But this gives a compile error. I also tried... (*(ar+index)).nbit = 1; ...but with the same lack of results. Is it not possible to get quick access to bits in an array? They seem to be treated differently than just a single variable. -- Ian Smith
  2. Success! I ran into a 'bug' in the PIC part itself. I found the solution here: http://forum.microchip.com/fb.aspx?m=306403 The 16F88 and a few other chips become unprogrammable if you use MCLR as an IO pin, you use the internal osc, and you set TIMER1 to use the internal osc as a clock source. If you do all three, you can no longer program the part. The post gives the solution to recovering the chips.
  3. Ahh... that could be it. I assume the PICkit2 is low voltage only? I have a Warp-13 that has never worked quite right. It uses the same pins to program, so it's low voltage as well? Is there any way to reset the PICs back to blank so they can be used again?
  4. Not really a C question.. but... I have been using the free version of SourceBoost C to play around and had it working for a few attempts, but the I seem to have done something bad with my config fuses because after programming the chips, they can't be read or written to anymore. I have two programmers, the latest a PICkit2 does not even see the 16F88 after it's been programmed. Suspecteding the fuses, I changed them to 3FFF 0000 with the same exact code, and that programms correctly and leaves me with a chip I can continue to read and write flash data to. Here is what I was using to compile... #pragma DATA _CONFIG1, _CP_OFF & _CCP1_RB3 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _INTRC_IO #pragma DATA _CONFIG2, _IESO_OFF & _FCMEN_OFF If I change the lines to following, it does program and verify... #pragma DATA 0x2007, 0x3FFF #pragma DATA 0x2008, 0xFF Is there anything in my _CONFIGs that would be killing my ability to re-program these? Am I somehow activating code protect? Any way to recover the chips? The PICkit2 has a erase option, but it won't enable it since it doesn't see any of the messed up chips. Anyone have an idea what I am doing wrong? Square plug in round hole? Thanks!
×
×
  • Create New...