Help for 16F690

Discussion in 'Programmer's Corner' started by FroceMaster, Feb 9, 2012.

  1. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    Hi.
    Have this project i will do.
    It's for counting rain,.

    Have a 16F690 and a 20*2 LCD.

    Need to bulid a clock, cause i need the midnight shift
    Normal readout on display will be.
    First line . " Total rain xxx mm".
    Second line " Today xx mm"

    When pressing SW1. ( Select button )
    First press, change line 2 to "Monday xx mm"
    next press change line 2 to "Sunday xx mm"
    Next press change line 2 to "Saturday xx mm"
    next press change line 2 to "Friday xx mm"
    ect.

    until day is -7 from today.
    Next press will show on first line "Time of day ( TOD )"
    Second line " Monday "
    Next again will return to normal.
    When nothing is pressed for 10 seconds, it also returns to normal....

    SW2 is for rest of "total rain" need to ask for confirmation, sure you want to delete total ? Y/N.

    SW3 - SW4 - SW5 can only be used when SW1 has ( TOD ) Selected.
    SW3 is for adding 1 hour to TOD,
    SW4 is for adding 1 minute to TOD.
    SW5 is for day of week, rotate from monday to sunday,....

    Hope you can follow me in what i am planng to do ??

    I have never done a programming of a PIC.
    Have done many windows programs.

    Have a 16F690 and a PicKit 2 starter kit.
    LCD is 20*2 https://www.elfaelektronik.dk/elfa3~dk_da/elfa/init.do?item=75-512-37
    Can someone please help me getting startet,

    Rgds
    FroceMaster
     
  2. nerdegutta

    Moderator

    Dec 15, 2009
    2,517
    785
    You might want to draw your circuit first, and be sure that it works. Then you download MPLAB with Hi-tech C, or MikroC, and start programming.
     
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    You must allow your self some learning curve. Some of the things you plan to do is not on a beginner level. But you have a good toolbox in your current equipment. First decide what kind programming language you want to use C/Assembler/Basic. Then write a very simple program that turn on a LED. Then the next step would be to get that LED blinking.
     
  4. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    Is there a good program to make the schematic in ?

    And how can it be testet that it will work ?
     
  5. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    What is your experience with electronics?
     
  6. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    Well i have learn in school, and have work with it sometimes,
    I build some small project mostly with logic 74 and Cmos 4000 circuits.
    But when i show you guys the layout for this i logic circiuts, you all say i should use microcontroller, it was so simpel to build.
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I remember that rain gauge circuit. And yes building with discrete logic would have been a impracticable task. Now you are equipped with a much better toolbox. And your project should be doable with very few support circuits. But you must give your self time to learn your new tools. That most of all be a process of many small learning steps. Not so many big ones.
     
  8. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    No matter witch demo i run, that came with the kit,
    it just writes "unable to enter debug mode"
     
  9. nerdegutta

    Moderator

    Dec 15, 2009
    2,517
    785
    I think this has to do with crystal and oscillator settings. Check documentation.
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    You can not debug the 16f690 chip without some extra hardware named debug header. By the way what examples are you referring to. Can you post some examples
     
  11. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    yes is the header that is missing,
    nothing mension when i buy this, all is included, also samples for testing but the sampels can not run without extra,...
     
  12. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    What samples do not run properly? I have never had any problem with the samples in your kit.
     
  13. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    Hello world., is the first
     
  14. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    PK2Error0024 PICKit2 was unable to establish a valid Vdd on the target Attemted 5.00v, read 0.00v , and i have external power, 5v, 100 % sure.
     
  15. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Try without the external power supply. It is nothing wrong in using an external power supply (5 Volt). But the board can also take power from the PICKIT 2 programmer.
     
  16. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    tried first without extra power, then i connect power, still same error
     
  17. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Have you open the workspace file? Try to open "Hello World.mcw" file that should ensure you that all MPLAB settings are correct. If you use a non English version of windows. It might be that you have to give the correct path for the include file.
     
  18. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
    Make: The target "C:\PK2 Lessons\LPC Demo Board\01 Hello World\Hello World.o" is out of date.
    Executing: "C:\Program Files\Microchip\MPASM Suite\MPASMWIN.exe" /q /p16F690 "Hello World.asm" /l"Hello World.lst" /e"Hello World.err"
    Error[105] C:\PK2 LESSONS\LPC DEMO BOARD\01 HELLO WORLD\HELLO WORLD.ASM 32 : Cannot open file (Include File "AC162061.inc" not found)
    Message[302] C:\PK2 LESSONS\LPC DEMO BOARD\01 HELLO WORLD\HELLO WORLD.ASM 38 : Register in operand not in bank 0. Ensure that bank bits are correct.
    Halting build on first failure as requested.
    ----------------------------------------------------------------------
    Release build of project `C:\PK2 Lessons\LPC Demo Board\01 Hello World\Hello World.mcp' failed.
    Language tool versions: MPASMWIN.exe v5.37, mplink.exe v4.37, mplib.exe v4.37
    Thu Feb 09 21:02:15 2012
    ----------------------------------------------------------------------
    BUILD FAILED
     
  19. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Is this a kit from Microchip, or a DIY PICKit 2 clone?

    Which demo board do you have? (part number)
    Are you running the PICKit 2 direct from the computer and not through 3 hubs?
     
  20. FroceMaster

    Thread Starter Member

    Jan 28, 2012
    400
    4
Loading...