PIC18F452 and problem with if statement


Results 1 to 4 of 4

Threaded View

  1. #1
    Stephan P.'s Avatar
    Stephan P. Guest

    Default PIC18F452 and problem with if statement

    Morning,
    I write something to the memory and read it later, compare it and change it if it is necessary. My problems are now this commands:

    scale0_min = ERead 30
    If scale0_min < -100000 Then scale0_min = 0 'look if scale_min is stored
    If scale0_min >= 100001 Then scale0_min = 0
    scale0_max = ERead 34
    If scale0_max < -100000 Then scale0_max = 100 'look if scale_max is stored
    If scale0_max >= 100001 Then scale0_max = 100

    scale1_min = ERead 38
    If scale1_min < -100000 Then scale1_min = 0 'look if scale_min is stored
    If scale1_min >= 100001 Then scale1_min = 0
    scale1_max = ERead 42
    If scale1_max < -100000 Then scale1_max = 100 'look if scale_max is stored
    If scale1_max >= 100001 Then scale1_max = 100

    scale2_min = ERead 46
    If scale2_min < -100000 Then scale2_min = 0 'look if scale_min is stored
    If scale2_min >= 100001 Then scale2_min = 0
    scale2_max = ERead 50
    If scale2_max < -100000 Then scale2_max = 100 'look if scale_max is stored
    If scale2_max >= 100001 Then scale2_max = 100

    wanted to make it easier with IF.. THEN.. ELSEIF... THEN... ENDIF. When i do that the PIC is reseting the whole time. Also when i use IF... OR ... THEN. Program usually with C so maybe it is just not possible to do it like that.
    If someone can tell me whats going on i will be very happy.

    Stephan
    Attached Files Attached Files

Similar Threads

  1. problem whit pic18f452
    By ocastrillo in forum General
    Replies: 3
    Last Post: - 9th March 2007, 16:18
  2. PIC18F got some weird problem?
    By NatureTech in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 19th February 2007, 16:18
  3. PIC18F452 Compile Problem
    By scottl in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 21st October 2006, 10:47
  4. Replies: 5
    Last Post: - 26th March 2006, 19:26
  5. interupt & Sleep Problem - HELP!!
    By Santana in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd November 2004, 10:39

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