Newbie question... why dont this work...??


Closed Thread
Results 1 to 5 of 5
  1. #1
    shax's Avatar
    shax Guest

    Unhappy Newbie question... why dont this work...??

    Hi all,
    sorry if I appear to be a thicko newbie, but last week I bought Proton from Crownhill, and I am having a slight (?) headach trying to get my code to work!

    For a project I am trying to get an RF module to run three very simple output routines.. flash led, make a sound, do both, etc...

    I am using a 12f629, the code seems to compile ok, with no errors, but no matter what I try, the routines always seem to get stuck in a repeating loop. They never break out, or return to their respective gosub calls.. the chip is being programmed / erased with a PicKit1 doofer... Eventually I want to use the rfPIC12F675f

    I know I am doing something REALLY stupid, but any comments would be a help.. and I'd like to get this sorted before I commit to making some pcb's!

    Cheers in advance,
    Shax.



    '=================================
    ' project :
    ' author :
    ' date : 06-09-2005
    ' test device : 12f629
    ' revision : 0.02b test code
    '=================================

    Device=12F629 'define processor
    Set OSCCAL
    Config INTRC_OSC_NOCLKOUT, MCLRE_OFF ' internal 4mhz osc, MCLR internal


    ' setup ports
    TRISB = %11000011 ' define port pin assignments
    Symbol LED = GPIO.4 ' LED output on port 4
    Symbol DATA_OUT = GPIO.2 ' DATA_OUT output on port 2
    Symbol RF_ENABLE = GPIO.5 ' RF_ENABLE output on port 5

    'NEXT BIT SETS PORTS IN INITIAL STATE
    Low RF_ENABLE
    Low LED
    Low DATA_OUT

    ' define variables
    Dim tx_delay As Word
    tx_delay = 1000
    Symbol max_delay = 15000
    Dim reps As Byte
    Let reps = 0
    Dim warp As Byte

    GoSub LOOP
    GoSub Theme
    GoSub loop2
    ' start of standby routine loop
    LOOP:
    For reps = 0 To 10
    High LED
    High RF_ENABLE
    DelayMS 50
    Low LED
    Sound DATA_OUT,[120,12]
    DelayMS 5
    Sound DATA_OUT,[120,12]
    DelayMS 50
    Low RF_ENABLE
    DelayMS 5000
    Next
    Return 'never gets here


    Theme: Low RF_ENABLE ' i ripped this section from the proton samples to see what would happen... still dont work!
    High RF_ENABLE
    DelayMS 50
    Sound DATA_OUT, [50,60,70,20,85,120] ' this is how far this routine gets ( if selected by first gosub) before repeating if selected!
    Sound DATA_OUT, [83,40,70,20,50,20]
    Sound DATA_OUT, [70,20,90,120,90,20]
    Sound DATA_OUT, [98,160]
    DelayMS 500
    '-------
    For warp = 128 To 255
    Sound DATA_OUT, [warp,2]
    Next
    '-------
    Sound DATA_OUT, [43,80,63,20,77,20,71,80,51,20,90,20,85,140,77,20,8 0,20,85,20,90,20,80,20,85,60,90,60,92,60,87,60,96, 70,0,10,96,10,0,10,96,10,0,10,96,30,0,10,92,30,0,1 0,87,30,0,10,96,40,0,20,63,10,0,10,63,10,0,10,63,1 0,0,10,63,20]
    DelayMS 50
    Low RF_ENABLE
    DelayMS 10000
    Return

    loop2: 'never gets here, unless selected by first gosub
    Low LED
    High RF_ENABLE
    Sound DATA_OUT,[50,12,60,12,70,12,60,12,50,12]
    Low RF_ENABLE
    Let tx_delay = tx_delay + 5
    DelayMS tx_delay
    If tx_delay > max_delay Then tx_delay = max_delay
    GoTo loop2

  2. #2
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Lightbulb Uhm.... try here

    ..last week I bought Proton from Crownhill..
    Try posting your question HERE. This forum is for Melabs Picbasic compilers.

  3. #3
    shax's Avatar
    shax Guest


    Did you find this post helpful? Yes | No

    Default Ooops....

    OOOPS... if I've posted in the wrong forum, my apologies....
    But can anyone offer some advice other than "please go away and bug someone else"..?
    All the bumf with the product shouts CROWNHILL.. so does the picbasic.co.uk website... Hmm.... picbasic.org AND picbasic.co.uk are both registered to Crownhill...ooops... silly me for putting 2 and 2 together and getting PI!!!

    is there anyone out ther that can post a sensible reply to my question?

    shax.

  4. #4
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Angry Are you kidding???

    Quote Originally Posted by shax
    is there anyone out ther that can post a sensible reply to my question?
    shax.
    I can't believe I'm replying to this again.... as I said earlier, this forum is for the Melabs Picbasic compilers. Yes it is Crownhill's site. Crownhill is a distributor of the Picbasic compilers. Crownhill also sells the Proton compiler, the one you have. My previous post gave you a link to their forum, where you should be able to find the answer to your problem with the product you have. So when you say
    can anyone offer some advice other than "please go away and bug someone else"..?
    I've given you a place where there are folks with experience with your chosen compiler which can provide the information you need.

    rhino - excuse the dinky little edit - Melanie
    Melanie - No problem... I understand - rhino
    Last edited by rhino; - 8th September 2005 at 15:08.

  5. #5
    shax's Avatar
    shax Guest


    Did you find this post helpful? Yes | No

    Default OOOPS again!!

    Rhino,
    I took your advice and posted on the Proton forum... got the info I needed..

    Thanks for pointing me in the right direction...

    Sorry if I p155ed anyone off....

    shax.

Similar Threads

  1. Can't get POT work on P12f675 - Newbie
    By berslan in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th March 2008, 21:22
  2. Newbie 74hc595 question
    By manjero in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 22nd January 2008, 22:22
  3. newbie with serial com question...
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th December 2006, 05:34
  4. Newbie Question - Info Please
    By ehoskins in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd October 2006, 14:50
  5. Greetings from Newbie and a question
    By ChrisHelvey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th July 2006, 15:52

Members who have read this thread : 1

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