Menu

Hello World Not working on 16f1829 but does on 16f690 -- Thanks

Help
ofuzzy1
2013-09-20
2013-09-22
  • ofuzzy1

    ofuzzy1 - 2013-09-20

    Fixed!

        clrf ANSELC
    

    Thanks Kent!

     - Jibberish is on the display, so we know the chip is working.
    

    Using:
    gcbasic compiler 2012nov04
    graphical GC of 9.3
    ;**

    The project is for middle & high school students.
    I am planning on having them use Tiny PIC bootloader: www.etc.ugal.ro/cchiculita/software/picbootloader.htm?
    Uses less than 100 words of program space

    Load via a USB-RS232_ttl on a hser port CP2102 or PL2303 [ebay <$3]
    

    The board is 1.5" x 3"

    20 pin Pic, 16f1829, 16f690
    Power pins @ 1 and [8 | 14 | 18 | 20]
    Any 8, 14, 18, 20 pin "new" pinout

    The Board Features:
    Ports:
    LCD Parrallel 1x16 Hitiachi type
    LCD SPI 1x 8 Nokia 5110... type
    I2c 1x4 v-, V+ sda, scl -- 2 headers
    RS232 [in=a.3 +22kohm software, out=a.0 +1kohm]
    nRF24L01 2x4 pin - SPI RF radio

    1x1.5" Prototying area

    Other parts: lm7805, lm1117-3.3v, 10k trim pot [lcd contrast], xtal, 2.1mm-F power

    ;**

    The code is just a simple "Hello World"

    It works for on a 16f690:

    ;Chip Settings
    #chip 16F690,4
    -------------------------->> Thanks for any help !!  Fuzzy
    
    ;**************
    ;***********************************************************************;***********************************************************************;***********************************************************************
    ;Chip Settings
    #chip 16F1829,4
    
    ;Defines (Constants)
    #define LCD_IO 4
    #define LCD_DB4 PORTC.0
    #define LCD_DB5 PORTC.1
    #define LCD_DB6 PORTC.2
    #define LCD_DB7 PORTC.3
    #define LCD_Enable PORTC.4
    #define LCD_RS PORTC.5
    #define LCD_NO_RW 'Needed when RW is grounded
    
    ;Variables
    Dim xB As byte
    
    main:
    Dir PORTC Out
    CLS
    For xB = 1 To 20
        Print "Hello World ", xb
        Wait 250 ms
    Next
    goto main
    end
    
     

    Last edit: ofuzzy1 2013-09-22
  • Anobium

    Anobium - 2013-09-21

    First thing I would do, install the latest GCB.

    Download from here, http://gcbasic.sourceforge.net/newfiles/update.zip or if you want a completed toolset try here, http://www.franksteinberg.de/ZIPS/GCB%40Syn.zip - Thanks go to Frank!!!!

    When you install, locate the directory and you will see the Great Cow Graphical BASIC application.

    Let us know the results of trying this version of GCB.

     

    Last edit: Anobium 2013-09-21
  • Chuck Hellebuyck

    Frank's link doesn't work.
    I get a 404 error.

     
    • Anobium

      Anobium - 2013-09-21
       
  • Anobium

    Anobium - 2013-09-21
     
  • ofuzzy1

    ofuzzy1 - 2013-09-21

    Frank Thanks, but that did not work.
    If you want a PCB I'll gladly send a you & Hugh one each- unpopulated.
    1"square 8pin PICs
    1.5x3 8,14,18,20 pin PICs
    1.5x4" 28 pin PICs USB "UBW" with the features below -- UBW=USB Bit Wacker vairant -- & SD Ram card with the features below
    24mm x 9" Rocket PIC -The UBW & 2 accelerometers [200g_Analog and i2c 4g,8,12g] & i2c pressure sensor.

    I will post later today a logic analyzer output.
    -- ignore the i2c-spi interface that was for something special.

     

    Last edit: ofuzzy1 2013-09-21
  • Anobium

    Anobium - 2013-09-21

    Can you confirm the code works without the bootloader, for both chips? Thank you. I want to check the basics first.

    :-) This Anobium.... not Frank. I was thanking Frank for his good work.

     

    Last edit: Anobium 2013-09-21
    • ofuzzy1

      ofuzzy1 - 2013-09-22

      Anobium, oops on calling you Frank. :)
      Anobium: Offer still stands on the boards.

      Attached are 2 logic analyzer snap shots. [Open Bench - $50]
      http://www.seeedstudio.com/depot/preorder-open-workbench-logic-sniffer-p-612.html?cPath=75

      The first 690, the last is 1829.
      It appears the time delay between bits is not long enough.
      Slowing it down with did not work. #chip 16F1829, 0.125
      image 4 is @ 1.40 ms

       

      Last edit: ofuzzy1 2013-09-22
      • ofuzzy1

        ofuzzy1 - 2013-09-22

        one more run
        500kHz @ 45ms after rs goes low

        It appears that the hold time on some of the bits is not long enough.
        foobar

         

        Last edit: ofuzzy1 2013-09-22
  • kent_twt4

    kent_twt4 - 2013-09-22

    Is this associated with ANSELC not being cleared in the GCBASIC INITSYS sub? This has come up several times before here on the forum. Try adding it before Main:

    clrf ANSELC
    

    In certain situations, forget which devices and under what circumstances, it helps when "writing" to a port, or using #defines, by using LATC.x instead of PORTC.x

     
    • ofuzzy1

      ofuzzy1 - 2013-09-22

      Kent Your the Man!
      Something so simple: clrf ANSELC
      Thanks a bunch!

       
  • Anobium

    Anobium - 2013-09-22

    Kent... nice one!

    Ofuzzy. I would like to take you up on your offer. email me. I am in UK, where are you? re: Hugh, if acceptable to Hugh I can get an item couriered to him (for free).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.