Counting led blinks..


Closed Thread
Results 1 to 40 of 93

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    Hi mackrackit, sorry if was not making clear. I want to read back from eeprom in the format of example "12345" or "65432" and I can do this uisng the following code.
    Code:
    if Key = "A" then
    READ 0,x
    serout2 PortD.5,84,[$D,Dec x," "]
    pause 1000
    for address=0 to x
        READ address,asciichar
        serout2 PortD.5,84,[$D,asciichar]
    next address
    pause 1000
    cnt = 0
    endif
    And I noticed that if I rewrite the value of DATA @6,5,"54321" by entering "19325" and read it back I get "QZu" not "19325"..how do I resolve this?
    I will try to test the sdcard tonight, hope something comes up....

    thanks,
    tacbanon
    Last edited by tacbanon; - 2nd November 2011 at 11:59.

  2. #2
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    Hi I finally got my eeporm problem solved..I figured that it needs 2 location space in between.
    Code:
    DATA @0,5,"12345"
    DATA @7,5,"54321"
    DATA @14,5,"14332"
    DATA @21,5,"24432"
    DATA @28,5,"85921"
    works great...
    BTW just want to ask if there is a possible to press a key that consist of several characters, for example if I pressed key 1 in successive I can get a character 'a','b','c'. similar to a cellphone keypad.

    regards,
    tacbanon
    Last edited by tacbanon; - 2nd November 2011 at 14:01.

  3. #3
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    I found one link http://www.picbasic.co.uk/forum/showthread.php?t=11209 but not sure how to to do it...but I will try..

    regards,
    tacbanon

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    Melanie's example is good, but the methods talked about at the start of this thread might be better.
    Timer/Counter from TIMER0.
    It should work well with all of the other stuff going on.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    Hi, I'm sorry about that(I'm misleading the thread), anyway I borrowed an sdcard from a friend...but he never tested it yet and doesn't have datasheet..hopefully I don't blow it up
    Here are the List I done & planning to do on my project in this thread.
    1. Use Timer/Counter from TIMER0 for multi coin-acceptor(pic16F877 and 18F4550) -Done
    2. Test RTC and Sdcard separate program- Done
    3. Incorporating Multi coin acceptor-RTC and Keypad on 4550 - Done (I need the keypad for access and view settings.)
    4. Incorporate SDcard for saving RTC data and number of coins dropped - not yet
    5. Use USB CDC to dump data(rtc and number of coins) from SDcard to terminal communicator - not yet


    I appreciated the help and the knowledge I got on this forum...not easy task(for me) but you encourage me to try it out...


    thanks again,
    tacbanon
    Last edited by tacbanon; - 3rd November 2011 at 10:18.

  6. #6
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    Hi, I have only one 4550 and I want to try it to another chip, I only have pic18f2550..I followed some instructions to comment the default config fuse in PBP INC files. I tried to compile this part of the code..
    Code:
        '<FL_PIC18F2550>'    '<FL_PBPL>'
        DEFINE OSC 48
        @ __CONFIG   _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
        @ __CONFIG   _CONFIG1H, _FOSC_HSPLL_HS_1H
        @ __CONFIG   _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
        @ __CONFIG   _CONFIG2L, _PWRT_ON_2L & _VREGEN_ON_2L
        @ __CONFIG   _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H
        @ __CONFIG   _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
        Include "modedefs.bas"
            ' Alias PIC pins and registers for SD/MMC card
        SD_WE        VAR    PORTA.4    ' SD card write protect
        SD_WE_TRIS   VAR    TRISA.4    ' SD card write protect direction
        SDI          VAR    PORTA.5    ' SPI data in SD #7
        SDI_TRIS     VAR    TRISA.5    ' SPI data in direction
        SCL          VAR    PORTA.3    ' SPI clock  SD #5
        SCL_TRIS     VAR    TRISA.3    ' SPI clock direction
        SD_CS        VAR    PORTC.2    ' SD card chip select SD #1
        SD_CS_TRIS   VAR    TRISC.2    ' SD card chip select direction
        SD_CD        VAR    PORTC.0    ' SD card detect
        SD_CD_TRIS   VAR    TRISC.0    ' SD card detect direction
        SDO          VAR    PORTC.1    ' SPI data out   SD #2
        SDO_TRIS     VAR    TRISC.1    ' SPI data out direction
    But gives me the following compilation error...
    Name:  compile_erro.gif
Views: 492
Size:  8.9 KB

    regards,
    tacbanon

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    Use the same configs for the 2550 as you did for the 4550.

    The only thing you need to do to move to the 2550 is change some pin assignments if you were using some on the 4550 that the 2550 does not have.

    Make sure you have all of the needed files in the new project directory.
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Counting led blinks..

    Thanks mackrackit, I just found out that the sdcard module I ordered will take a while(2weeks from china). The sdcard I borrowed did not work either.In the meantime...I will be working on the keypad codes for accessibility feature of this project...be back soon.
    Last edited by tacbanon; - 5th November 2011 at 15:38.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts