• PicŪ Basic


  • Number of Cycles

    If you want to know the number of cycles it takes to perform a task on a PICŪ the following gives an example...

    INCLUDE "PROTON_G20.INT" 'Proton 20MHz Graphics LCD
    DIM TIMER1 AS TMR1L.WORD 'See help file
    DIM X AS FLOAT
    DIM Y AS FLOAT 'Dim some FLOATS
    DIM Z AS FLOAT

    DELAYMS 500 'Give PICŪ a chance to wake-up

    CLS 'Clear the GLCD

    X = 1234.321 'Load 1234.321 into X FLOAT
    Y = 3.33 'Load 3.33 into Y FLOAT

    CLEAR TIMER1 'Clear TIMER1
    '#########################
    T1CON = %00000001 'Enable the Timer

    Z = X * Y 'Code to calculate

    T1CON = %00000000 'Stop the Timer
    '#########################

    PRINT AT 0,0,"CYCLES ",DEC TIMER1 'Print out the number of Cycles
    PRINT AT 2,0,"ANSWER ",DEC Z 'Print out Answer
    END
    contributed by RON
  • Recent Activity

    xldaedalus-432

    Mysterious PORTB problem

    Thread Starter: xldaedalus

    I'm using Proton+ to develop firmware for a product with switches. The MCU is an 18F26K22. Most of the switches reside on PORTB. I am NOT using a...

    xldaedalus Yesterday, 18:21 Go to last post
    Les-15

    Pic16f18877 oread

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the OREAD command doesn't seem to work. The code is working on a PIC16F1939. Both controllers use 32MHz int osc. If i...

    Les Yesterday, 13:05 Go to last post
    amod-29593

    Multiple functions by a single switch

    Thread Starter: amod

    Hi, How can I use multiple function by a single switch.I want to use 4 functions by a single switch.

    amod Yesterday, 15:31 Go to last post
    Oldhack-15978

    FUSES for PIC18F47K20

    Thread Starter: gtv_pic

    000 Good morning I am using the PIC18F47K20 and in the help of the proton I did not locate the FUSES for said micro. Where can I locate...

    Oldhack Yesterday, 16:34 Go to last post
    Les-15

    SHIN generates ASM ERROR with the 16F18877

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the SHIN command generates an ASM ERROR: Could this also be related to renamed or moved SFRs in the newer controllers? ...

    Les Yesterday, 19:18 Go to last post