Syntax Errors on Lines in C Program

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Syntax Errors on Lines in C Program

1,039 Views
bpaehr
Contributor IV

I am an old assembler guy, just getting started in C using CodeWarrior 10.6.4 on an MC9S08QB8 device.  I have had the target up and running using an assembly program, but now I wish to try changing over to C.  A simple sample program is shown below in the IDE debugger.  The code is supposed to set up a 10mSec Modulo Timer and just toggle a microprocessor pin high/low on each 10mSec interrupt.  I am getting two syntax errors: one on the Initialize_CPU call, (with that routine also shown), and the other on the ISR for my Modulo Timer.  The ISR format was taken from NXP/Freescale's "HCS08QRUG Rev. 1" document in the "Implementing Interrupt Service Routines" section.  Does anyone know why I'm getting the Syntax Errors?  Does either syntax error deal with the need for Function Prototypes that I've seen, like in C++ ?  Also, if I were to have several separate .c source files, is there anything I need to do to allow one source file to "see" the functions in the other source files?

 

153564_153564.jpgSyntax Errors in Simple C Program for HCS08.jpg

Labels (1)
0 Kudos
6 Replies

762 Views
bpaehr
Contributor IV

Alice:

Thank you for your responses. Unfortunately, I was not able to get your version of s08_test to work.

After much fumbling about and researching other sample HCS08 code, I was finally able to get my simple 10mSec interrupt to toggle an output bit on the processor.

I consider this thread closed.

0 Kudos

762 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello BOB,

Could you please show the console windows of the CW and send your project to me ,

then it is facilitate to check the problem .

BR

Alice

0 Kudos

762 Views
bpaehr
Contributor IV

By the way... Shall I assume after much digging into the Codewarrior menus and trying to find Help on Generating Code (automatically) that the "free" version of CW 10.6.4 does NOT allow me to "Add to project" anything that can be found in the "Components Library", as can be seen here:   ?

Components Library - Add to Project Not Available.jpg

0 Kudos

762 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello BOB,

- You can click the "Actions", then " Edit” , then "Attach"

pastedImage_1.png

pastedImage_0.png

If on your side , you can not find these buttons ,you can send it to    alice.yang@nxp.com .

- The free CW can also add the component , you should first create one Processor Expert project :

pastedImage_3.png

then you can double click the component you want to use

pastedImage_2.png

Also in the  help on component, there is the demo about how to use the component and the detail information .

I also attached the project  i create .

Hope it helps

Alice

0 Kudos

762 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello BOB,

After you send email to me , please mentioned me at here, or maybe i will ignore your email.

About your project, your interrupt vector have not write to the vector table ,  while it also have other

errors, so i refer to your demand create one new project , add two component.

The TimerInt component is usd for timer interrupt , the BitIO component is used for gpio to toggle LED.

Configure the Timer interrupt period to 10ms :

pastedImage_0.png,

For i have not the board, so i have not test it , you can test it on your side , check whether it can enter

the interrupt function :

pastedImage_1.png

I use the port A-3, if i'm wrong , you can change it on the BITIO component .

Hope it helps


Have a great day,
Alice

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

762 Views
bpaehr
Contributor IV

Alice:

Here is a screenshot of the Console Windows showing "CodeWarrior Projects", "main.c", the "Project Explorer" with as many items expanded as possible, and the Console window:

TST_C0000 Console Windows 160615 830AM.jpg

I have also Zipped my project, but I do not see any capability to upload that ZIP file to you.  I tried to use "Insert Image" for my ZIP file, but it said that that type of file was not allowed.  I tried using the "Upload Files" part of the "Create" Menu (the Pencil icon), but I don't understand what needs to be done for creating a space for things.

If you can provide an e-mail address or an explanation of the "Upload Files" process, I can send the ZIP file of my project to you.

Thanks for your help.

Bob

0 Kudos