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?
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.
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
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: ?
Hello BOB,
- You can click the "Actions", then " Edit” , then "Attach"
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 :
then you can double click the component you want to use
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
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 :
,
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 :
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!
-----------------------------------------------------------------------------------------------------------------------
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:
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