Processing 2 different parts with 16F872 ?


Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    44

    Default Processing 2 different parts with 16F872 ?

    Hi there,
    Iīm a beginner in PicBasic and i want write my first program. It was really hard enough for me to change the configuration bits of this PIC cause of WDT problems.
    Now my question is very simple.
    Is it possible, that the PIC is running two different processes at the same time?
    e.g. the 1st process only works once, when power up my board
    and the second part is searching for a pressed button (matrix)
    How can i solve this problem that both parts work simultanously?
    Maybe someone can help me?
    Iīm using MicroCode Studio v3.0.0.0, Pic Basic Pro Compiler v2.47 & MPLAB IDE V7.60
    I hope that my english isnīt too bad and you can understand me...

    '****************************************
    '* Name : Matrix.BAS *
    '* Author : Robson *
    '* Notice : *
    '* : All Rights Reserved *
    '* Date : 20.06.2007 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '****************************************
    ' first process starts here
    ' this routine should run once by power up the PIC

    for x = 1 to 5 ' Wait 10 Seconds
    pause 2000
    next x
    PORTB.1 = 0

    for x = 1 to 3 ' Wait 6 Seconds
    pause 2000
    next x
    PORTB.1 = 1

    for x = 1 to 2 ' Wait 4 Seconds
    pause 2000
    next x
    PORTB.1 = 0
    ' this was the 1st part which only runs on startup
    ' for this time (20 seconds) the input on the matrix donīt work
    goto main

    ' here starts the second Part which should run simultanously
    ' while the first part is running
    main:
    col1 = 1
    col2 = 0
    col3 = 0
    savepos = pos

    if row1 = 1 then
    pos = 4
    endif
    if row2 = 1 then
    pos = 3
    endif
    if row3 = 1 then
    pos = 2
    if savepos = 0 then goto main
    endif
    goto col2check
    ' etc .......
    goto main
    end
    Last edited by Robson; - 21st June 2007 at 01:44.

Similar Threads

  1. How to drive the Vinculum VDIP1 in UART mode
    By BrianT in forum Code Examples
    Replies: 41
    Last Post: - 23rd May 2013, 12:34
  2. Replies: 4
    Last Post: - 15th April 2009, 01:54
  3. USB-FTDI[UM232R] with PIC16f877a
    By bjox in forum USB
    Replies: 1
    Last Post: - 23rd February 2008, 22:40
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

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