Advice please - Warning message


Results 1 to 40 of 51

Threaded View

  1. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    And... it was easier to hack than i thought....
    Code:
    Sel2:
    if swcount = 1 then READ ((Patt1>>0)+counts), PORTB  ;read the next value in patt1 and display it on PORTB
    if swcount = 2 then READ ((Patt2>>0)+counts), PORTB
    if swcount = 3 then READ ((Patt3>>0)+counts), PORTB
    if swcount = 4 then READ ((Patt4>>0)+counts), PORTB
    if swcount = 5 then READ ((Patt5>>0)+counts), PORTB
    if swcount = 6 then READ ((Patt6>>0)+counts), PORTB
    if swcount = 7 then READ ((Patt7>>0)+counts), PORTB
    RETURN
    OR for less code generated solution
    Code:
    Sel2:
    if swcount = 1 then READ ((Patt1+0)+counts), PORTB  ;read the next value in patt1 and display it on PORTB
    if swcount = 2 then READ ((Patt2+0)+counts), PORTB
    if swcount = 3 then READ ((Patt3+0)+counts), PORTB
    if swcount = 4 then READ ((Patt4+0)+counts), PORTB
    if swcount = 5 then READ ((Patt5+0)+counts), PORTB
    if swcount = 6 then READ ((Patt6+0)+counts), PORTB
    if swcount = 7 then READ ((Patt7+0)+counts), PORTB
    RETURN
    Enjoy!

    For sure there's way to reduce the code size but i leave this in your hand

    teaser
    Code:
    Addr=Patt7+counts
    Read addr, PORTB
    Select case is another one, LOOKUP too.

    And you can configure PORTB as digital in your config fuses with the right setting
    Code:
    _PBADEN_OFF_3H      ; PORTB<4:0> pins are configured as digital I/O on Reset
    _PBADEN_ON_3H       ; PORTB<4:0> pins are configured as analog input channels on Reset
    OR use

    ADCON1=$0F
    CMCON=7
    Last edited by mister_e; - 10th December 2006 at 03:01.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. PIC16F690 PBP boundary crossing warning message
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th May 2008, 12:17
  2. Micro Code Studio - Warning message
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th November 2006, 22:17
  3. MicroCode Studio Boundary Warning Message
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th March 2006, 10:13
  4. Message String Table using Readcode
    By mytekcontrols in forum Code Examples
    Replies: 2
    Last Post: - 11th July 2005, 00:17
  5. warning message
    By pic beginner in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd July 2004, 03:53

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