12F675: DEC modifier not accepted


Closed Thread
Results 1 to 6 of 6
  1. #1
    jswayze's Avatar
    jswayze Guest

    Default 12F675: DEC modifier not accepted

    I get a "bad expression" error in Microcode Studio on the SEROUT line below. When I remove the "DEC" modifier all works fine. Is there any reason DEC shouldn't be working here?

    I'm using Microcode Studio 2.2.1.1

    Thanks!

    Jeff

    Code:
    @ DEVICE INTRC_OSC, WDT_OFF, MCLR_OFF, PWRT_ON
    INCLUDE "modedefs.bas"
    define OSC 4     
    result VAR word		'A/D CONVERSION RESULT STORAGE BYTE
    ANSEL=%00100001		'SET GP.0 TO ANALOG INPUT, Fosc/32, ALL ELSE = DIGITAL I/O
    
    MAIN:
         GOSUB GETADC		      'SETUP A/D
         PAUSE 1000		          'PAUSE FOR 1 SECOND
         SEROUT GPIO.1,N2400,[dec result] 'SEND A/D CONVERSION RESULT TO THE PC SERIAL PORT
         PAUSE 1000		          'PAUSE FOR 1 SECOND
         GOTO MAIN
    
    GETADC:
         adcin 0,result
         return

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Did you tried Serout2 ?

    Ioannis

  3. #3
    Chris Mayhew's Avatar
    Chris Mayhew Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ioannis
    Did you tried Serout2 ?

    Ioannis
    I did, and it compiles OK with SEROUT2

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


    Did you find this post helpful? Yes | No

    Default

    The Fabulous Manual says black on white to use # with SEROUT.
    Steve

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

  5. #5
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    RTFM???

    Some of us just can't see the light at the end of the tunnel....

    Dwayne
    Attached Images Attached Images  
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  6. #6
    jswayze's Avatar
    jswayze Guest


    Did you find this post helpful? Yes | No

    Default

    You're right... TFM does indeed say "A numeric value preceded by a pound sign ( # ) will send the ASCII representation of its decimal value. For example, if W0 = 123, then #W0 (or #123) will send '1', '2', '3'. "

    I glanced through it but missed it since what I was looking for was:

    Modifier Operation

    {I}{S}BIN{1..16} Send binary digits

    {I}{S}DEC{1..5} Send decimal digits

    {I}{S}HEX{1..4} Send hexadecimal digits

    REP c\n Send character c repeated n times

    STR ArrayVar{\n} Send string of n characters


    Which is found in the SEROUT2 section.

    My bad, and I appreciate the helpful responses.

    -Jeff

Similar Threads

  1. Getting SERIN2 to work?
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 22nd July 2009, 20:10
  2. 12F683 vs 12F675.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th July 2009, 04:58
  3. LCDout $FE,2, dec Days - What is dec ?
    By merc07 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 24th June 2009, 04:03
  4. serout out of order on 12F675
    By Ricardo in forum Serial
    Replies: 7
    Last Post: - 29th April 2008, 00:16
  5. PBPL 2.50 observations
    By BrianT in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 17th September 2007, 23:58

Members who have read this thread : 1

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