Newbe problem


Closed Thread
Results 1 to 11 of 11

Thread: Newbe problem

  1. #1
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107

    Default Newbe problem

    I am using 16F627A, I started the program with:
    symbol PortA = 5
    symbol TrisA = $85
    The compiler reports: "syntax error"; what is wrong?

  2. #2
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Russ Kincaid
    I am using 16F627A, I started the program with:
    symbol PortA = 5
    symbol TrisA = $85
    The compiler reports: "syntax error"; what is wrong?

    Try this:
    TRISA = %10000101
    PORTA = %00000101

    Arch

  3. #3
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    PORTA = %00000101 changes the data register? That is not what I want to do.

  4. #4
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Russ Kincaid
    PORTA = %00000101 changes the data register? That is not what I want to do.
    What are you trying to change, if not the state of the port pins?

    Arch

  5. #5
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    I just want to define "PortA" as the number 5 so I can write "poke PortA" instead of "poke 5".
    Actually, I don't want to do any of that, I just want to know why there is a syntax error when it is identical to what is in the demo program, which is supposed to be correct.
    Last edited by Russ Kincaid; - 31st January 2006 at 20:21.

  6. #6
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default Are you using the right compiler for this forum ?

    Hi,

    Are you sure you have posted in the right place ?

    As far as I am aware Symbol is not part of PicBasicPro.

    I certainly have never needed to use it but have seen it used to declare aliases in Proton+.

    With regard to Peek and Poke, this is from the PBP manual...

    However, all of the PICmicro registers can be and should be accessed without using PEEK and POKE. All of the PICmicro registers are considered 8-bit variables by PicBasic Pro and may be used as you would any other byte-sized variable. They can be written directly or used directly in equations.

    TRISA = 0 ' Set PORTA to all outputs
    PORTA.0 = 1 ' Set PORTA bit 0 high


    Regards
    Keith

    www.diyha.co.uk
    www.kat5.tv

  7. #7
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hello,

    Peek and Poke are used in PicBasic not the Pro version. "Symbol" is a reserved word in PBP and is also used in the PicBasic Compiler.

    As for the programmer you are using, Chuck has several programmers on his site. Which one are you using and which compiler program are you using?

    Giving us as much detail as possible will allow us to help you quicker which also helps to reduce your stress point in dealing with PIC's.

    BobK

  8. #8
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by BobK
    Peek and Poke are used in PicBasic not the Pro version. "Symbol" is a reserved word in PBP and is also used in the PicBasic Compiler.
    Hi Bob,

    Thanks for that info. I wasnt aware that PBC was that different having only used the PRO version.

    Because I hadnt come across "Symbol" in PBP but had seen it in a Proton+ program that I read I thought that maybe the original poster was using Proton.

    I'll go back to sleep now
    Keith

    www.diyha.co.uk
    www.kat5.tv

  9. #9
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    I am using Microcode Studio and PicBasic Pro Demo compiler. The programmer is "EZPIC". I am getting my info from Chuck Hellebuyck's book, " Programming PIC Microcontrollers With PicBasic".

  10. #10
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Russ,

    I have this book in front of me. You just stated that you are using PicBasic Pro. Peek and Poke are not used in this compiler. Chuck's book gives examples for both PicBasic AND PicBasic Pro. You will see, for example on page 158 an example of a program using PicBasic. On page 160 you will see the same program only written for PicBasic Pro. This is probably why you are getting the syntax error message. You can do the same thing from one compiler to another as long as the way you write is compatible with the respective compiler.

    Quote from page 160 "If you compare the PBC program to the PBPro program it becomes clear that not having to PEEK and POKE makes the PBPro version much easier to use and understand."

    I started out using PBC after working with Stamps. I quickly found the shortcomings and jumped to PBPro. PicBasic was written to advance from Basic Stamps to PICs and PicBasic Pro was the progression from Basic Stamp 2's.

    Have another shot at the demo program using the Pro demo.

    Have a nice day!

    BobK

  11. #11
    Join Date
    Jan 2006
    Location
    New Hampshire, USA
    Posts
    107


    Did you find this post helpful? Yes | No

    Default

    Thanks, I didn't realize that I was using the pro version.

Similar Threads

  1. Problem with ASM IRQ using FSR0 on PIC18F252
    By mytekcontrols in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 11th March 2008, 20:48
  2. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  3. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59
  4. weird 12F629/675 problem
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th October 2004, 01:08
  5. PORTA.PinNo = 1 ' problem
    By frank small in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th May 2004, 14:30

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