The EXT (external) modifier.


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Feb 2008
    Location
    Michigan, USA
    Posts
    231


    Did you find this post helpful? Yes | No

    Default

    OOPs!
    Thank You

    Sometimes RTFM is feels like looking at a forest and someone saying "the bunnies are right there, can't you see them?". Guess I just have to go into the woods and try again!
    Bo

  2. #2
    Join Date
    Feb 2008
    Location
    Michigan, USA
    Posts
    231


    Did you find this post helpful? Yes | No

    Default Visualization

    I was having trouble understanding the results that I was getting. I ran this to get a better view of how things were working. ...he can be taught...
    Code:
    INCLUDE "AllDigital.pbp"
    DEFINE OSC 8          ' this was run on an 18F2525
    OSCCON = %01110000
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    DEFINE HSER_SPBRG 34  ' 57600 Baud @ 8MHz, -0.79%
    SPBRGH = 0
    BAUDCON.3 = 1         ' Enable 16 bit baudrate generator
    ByteData    var byte[32] BANK0                                             
    Arg         VAR WORD  EXT 
    ArgWd0      var word
    ArgHi0      var byte
    ArgLo0      var byte
    ArgWd1      var word
    ArgHi1      var byte
    ArgLo1      var byte
    @Arg = _ByteData
    hserout["ArgTest",10,13]
    start:
    CounterB    var byte
    for CounterB = 0 to 31
    ByteData[CounterB]= CounterB
    next CounterB                                                                        
    
        hserout["Byte0= ",dec bytedata[0],", Byte1= ",dec bytedata[1],10,13]
        ArgWd0 = Arg[0]
        ArgHi0 = ArgWd0.highbyte
        ArgLo0 = ArgWd0.lowbyte
        hserout["Arg0 HiBtD= ",dec ArgHi0,10,13]
        hserout["Arg0 LoBtD= ",dec ArgLo0,10,13]
        hserout["Arg0 HiBtB= ",bin ArgHi0,10,13]
        hserout["Arg0 LoBtB= ",bin ArgLo0,10,13]
        hserout["Arg0 HiBtH= ",hex ArgHi0,10,13]
        hserout["Arg0 LoBtH= ",hex ArgLo0,10,13]
        hserout["Arg0= ",dec Arg[0],10,13]
        hserout["Byte2= ",dec bytedata[2],", Byte3= ",dec bytedata[3],10,13]
        hserout["Arg1= ",dec Arg[1],10,13]
        ArgWd1 = Arg[1]
        ArgHi1 = ArgWd1.highbyte
        ArgLo1 = ArgWd1.lowbyte
        hserout["Arg1 HiBtD= ",dec ArgHi1,10,13]
        hserout["Arg1 LoBtD= ",dec ArgLo1,10,13]
        hserout["Arg1 HiBtB= ",bin ArgHi1,10,13]
        hserout["Arg1 LoBtB= ",bin ArgLo1,10,13]
        hserout["Arg1 HiBtH= ",hex ArgHi1,10,13]
        hserout["Arg1 LoBtH= ",hex ArgLo1,10,13]
        hserout["Arg1= ",dec Arg[1],10,13]
       end
    The results were:
    Code:
    ArgTest                                                                       
    Byte0= 0, Byte1= 1                                                            
    Arg0 HiBtD= 1                                                                
    Arg0 LoBtD= 0                                                                 
    Arg0 HiBtB= 1                                                                
    Arg0 LoBtB= 0
    Arg0 HiBtH= 1                                                                 
    Arg0 LoBtH= 0                                                                 
    Arg0= 256                                                                     
    Byte2= 2, Byte3= 3                                                            
    Arg1= 770                                                                     
    Arg1 HiBtD= 3                                                                
    Arg1 LoBtD= 2                                                                 
    Arg1 HiBtB= 11                                                               
    Arg1 LoBtB= 10                                                                
    Arg1 HiBtH= 3                                                                 
    Arg1 LoBtH= 2                                                                 
    Arg1= 770
    That let me see that it was being stored like this:
    00000001 00000000 = 256
    00000011 00000010 = 770
    Don't know if that will help anyone, but it helped me understand a bit more.
    Bo

Similar Threads

  1. Replies: 1
    Last Post: - 28th January 2010, 23:15
  2. TMR1 external LP xtal setup check
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th October 2009, 19:11
  3. How to use an external oscillator
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th February 2008, 15:19
  4. External clock
    By Firegod in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th March 2007, 01:53
  5. switching external vref+ and vdd vref
    By alejandro_halon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th February 2005, 21:13

Members who have read this thread : 2

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