CodeWarrior Tools for 56800/E Hybrid Processors

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

CodeWarrior Tools for 56800/E Hybrid Processors

14,272 Views
marc_paquette
Contributor V
To help you find solutions to problems using CodeWarrior tools for 56800/E hybrid processors that have already been solved, we have posted this thread. Each message in this thread contains an entire topic ported from a separate forum.
Labels (1)
Tags (1)
0 Kudos
10 Replies

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
Dimer
Posted: Oct 17, 2005 - 09:36 AM   
 
Does anyone have any sample code using a portion of the Data Flash for Configuration settings. I tried to modifying the linker cmd file as follows
 
.x_flash_ROM (R) : ORIGIN = 0x1000, LENGTH = 0x0E00
.x_config_ROM (R) : ORIGIN = 0x1E00, LENGTH = 0x0200
 
to give me a 1K block at the top of the data flash section. I'm not quite sure if this is the right approach.
 
Next I used the IntFlash bean to generate some code for reading and writing to this configuration section.
 
Also I declared a static structure to hold my configuration defaults.
 
//Config Defaults
static const IMAGE_RAM_STRUCT DefaultCfg =
{
(byte)0xA5,
(byte)0, (byte)0, (byte)15, (byte)5, (byte)20, (byte)0,
(int)-87, (int)191, (int)0, (int)191, (int)-87, (int)6200, (int)16500
};
 
I am trying to copy the defaults in this structure to the flash I set aside earlier. Is the following legal?
 
WriteBlock((word)&DefaultConfig,(0x1E00*2),sizeof(IMAGE_RAM_STRUCT));
 
Am I passing in the source address correctly? Simply casting the address to a word?
 
Any specific help on these issues or general comments on a better way to save configuration settings will be most appreciated.
 
 
  
 
MMCLAUGHLIN
Posted: Oct 17, 2005 - 01:18 PM   
 
I used the 56F8357 and I used the processor expert. Doing it that way, I changed the build options of the cpu to include a flash_data at 2000h. When I wrote to it I used SetBlockFlash Method. You'll need to make sure you've erased the flash ahead if necessary and check the global protection bit. Hope this helps some.

 
0 Kudos

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
Jackson
Posted: Oct 17, 2005 - 11:00 PM   
 
Does anybody know of a way to store a C string with the byte pairs swapped in the 56800E compiler?
 
The following string:
ctCHAR string[] = "ABCDEF";
is stored by the compiler in words as BA CD EF
 
I would like the string to be stored as AB CD EF so that bytes are ordered correctly when passed to an external application as a stream of words.
I can achieve this ordering in assembler by using the DCB command, but I need to include the __DATE__ and __TIME__ macros in the string which the assembler does not know about.
 
Any ideas?
 
Also, is there a complete manual for the 56800/E compiler? I've found bits of info in various documents (eg. Targetting 56800E), but no definitive manual covering all pragmas, macros etc.
 
 
  
 
mw_pirrle
Posted: Oct 24, 2005 - 09:29 AM   
 
Hello,
 
Due to the architecture of the DSP processor, the string ctCHAR string[] = "ABCDEF"; is stored by the compiler in words as BA DC FE.
There is a setting to swap the memory to display AB CD EF.
To valid that you must click on Memory ! Swap Endian.
A memory component shoudl be opened.
However it will not be the case in the memory.
For my understanding, there are no way to change that.
 
Refer to the manual 56800x_Build_Tools_Reference.pdf.
This manual contains all info regarding the compiler tool.
This manual is available in DSP7.2.
 
Regards
Pascal Irrle

 
0 Kudos

1,921 Views
marc_paquette
Contributor V

To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.

 

MMCLAUGHLIN
Posted: Oct 07, 2005 - 07:53 AM   

I am looking for some examples using the pwm beans. Does anyone know of any? On the metrowerks resource pack there's a voice program but it does not use the beans and is very limited. Any help would be appreciated. 
 
 
  
mw_pirrle
Posted: Oct 24, 2005 - 09:39 AM   

Hello,

There are some examples in the installation folder:

<install_path>\Stationery\Processor_Expert_Examples\DemoApplications\HWBeans
Select the processor family you use.

Regards
Pascal Irrle
 

0 Kudos

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
 
Dimer
Posted: Nov 02, 2005 - 10:55 PM   
 
I noticed that when I cast a unsigned int to a float, the float is always truncated to zero decimal points. The following example code produces this problem.
 
word counts;
float fcounts;
counts = 1000;
fcounts = (float)counts + (float)0.6785;

If I view the variable fcounts in the debugger it will show 1000.
I can't seem to get it to not truncate the 0.6785
 
This only occurs when casting to a float. Any ideas on what I'm doing wrong or is this a problem with the IDE. 
 
 
  
mw_ron
Posted: Nov 03, 2005 - 12:32 PM   
 
Dimer wrote:
I noticed that when I cast a unsigned int to a float, the float is always truncated to zero decimal points. The following example code produces this problem.
 
word counts;
float fcounts;
counts = 1000;
fcounts = (float)counts + (float)0.6785;

If I view the variable fcounts in the debugger it will show 1000.
I can't seem to get it to not truncate the 0.6785
 
This only occurs when casting to a float. Any ideas on what I'm doing wrong or is this a problem with the IDE.

I think the problem is that the result is promoted to an int during the assignment use the float like this
 
fcounts = (float) ((float)counts+0.6785f);
 
Ron
_________________
Ron Liechty
Ombudsman for Metrowerks
 
  
 
Dimer
Posted: Nov 04, 2005 - 08:54 AM   
 
Thanks for the reply.
 
I think my issue was with my understanding of the debugger. I have since noticed that the debugger will only display 6 digits for a float. So if you have a large number you won't see anything to the right of the decimal point.

 
0 Kudos

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
cgates
Posted: Nov 04, 2005 - 02:34 PM   
 
I am working on a 56F8357 and have started using the COP watchdog.
All of the COP functionality seems to be working well, except there doesnt seem to be any way to determine if a reset is the result of the COP or just a normal power up.
I have no external power fail detect (so I cant set a flash flag on normal shutdown), and it appears that the reset returns all registers/flags back to their default condition. I am also out of GPIO inputs so even adding an R/C constant external to the DSP is not an option.
 
Has anyone found a way to detect a warm reset on this DSP?
 
Thanks,
Chris 
 
 
  
mw_pirrle
Posted: Nov 08, 2005 - 10:24 AM   
 
Hi,
 
The user can define the interrupt.
If the user creates a project via the stationery, a file named MC56F835x_vector.asm will contain the interrupt table.
By this way you can config the interrupt table.
 
Regards
Pascal Irrle 
 
 
  
cgates
Posted: Nov 08, 2005 - 12:53 PM   
 
I think I have found it…
 
Ya gotta love Freescale documentation!!! In the Peripheral User’s Manual on page 3-8 section 3.10 it states:
3.10 Resets
Any system reset forces all registers to their reset state, clearing the COP_RST signal if it…
 
Yet in the Data sheet for the ‘357 on page 98 section 6.5.2.3 it contradicts this:
6.5.2.3 COP Reset (COPR)—Bit 4
When 1, the COPR bit indicates the Computer Operating Properly (COP) timer-generated reset has occurred. This bit will be cleared by a Power-On Reset or by software. Writing a 0 to this bit position will set the bit, while writing a 1 to the bit will clear it.

So, based on this is appears that this bit is not really reset as previously implied and indeed is the flag to use to determine the source of the last reset (there is also one for a software reset). I have not tested this yet, but it seems to be the flag to check.

 
0 Kudos

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
 
Dimer
Posted: Nov 08, 2005 - 01:08 PM   
 
Background: I am trying to create a simple application that can be updated later. I am using the 56F8323 CPU and the EVM. I started with a Empty PE project. My application consists of only 1 bean a LED bean that toggles one of the EVM LEDs at a 1Hz rate. To add the bootloader functionality I modified the CPU build options to inlcude serial boot loader support. I selected a 30 second delay.
 
Issue:
Every time cycle power to the EVM board the LED starts blinking right away. I was expecting it to wait 30 seconds before I saw any LED activity.
I am a relative newbe to the CodeWarrior world. What am I missing in terms of generating an application that first loads the bootloader and waits for updates before starting my application. Any help from someone who already done this would be greatly appreciated. Thank You 
 
 
    
mw_ron
Posted: Nov 14, 2005 - 06:17 PM   
 
The bootloader project is available in the folder:

<install_path>\Stationery\Processor_Expert_Examples\Bootloaders\56F83xx\serial_bootloader
 
Open the project and build the code.
Processor Expert will generated all bootloader code and documentation that you need.
 
Ron
_________________
Ron Liechty
Ombudsman for Metrowerks
 
0 Kudos

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
 
Dimer
Posted: Nov 22, 2005 - 09:21 AM   

I have been developing on the 56F8323 micro. I am very please with it, but for cost reasons I am considering scaling back to the 56F8122. Currently I am using the serial bootloader to reflash the micro with new software. In the manual for the serial boot loader I came across the following statement:

Quote:

The Bootloaders application was not designed for the 56F81xx devices. The 56F83xx Bootloaders application does, however, fully support 56F81xx software development.

Can anyone explain what this means? I would like to use a bootloader with the 56F8122. Is there a different bootloader I need to use or will the bootloader for the 56F8323 work? Any experiences you may have had along these lines will be appreciated. 
 
 
  
MW_SMAUER
Posted: Nov 28, 2005 - 04:55 PM   

There is a bootloader for the 5681xx included with the product. Simply do a New-> Processor Expert Example Stationery, and chose the Bootloader -> 5681xx option.

Regards,

Scott


 

 
0 Kudos

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
 
edriano
Posted: Sep 23, 2005 - 08:12 AM   

Hello, I am new to Codewarrior for DSP, and when i am using Codewarrior for microcontrolers i am able to define Ports as volatile variable giving address, but with codewarrior for 56F i can not define this way, Am i doing something wrong, if Not how can i see GPIO content at debug enviroment, one more question is that possible to define a variable as periodic like in codewarrior for Hcs family.

thanks in advance. 
 
 
   
MW_SMAUER
Posted: Nov 28, 2005 - 06:45 PM   

The colon operator used to put a certain data structure at a certain location in memory isn't supported on Hybrid. The best way to interact with ports and peripherals is through Processor Expert. PE provides a lot of debugging insight into what's going on during debug. If you look at the PE docs regarding the peripheral in question, you should be able to see how to get GPIO info.

Regards,
Scott

 

 

 

0 Kudos

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
 
CCHEE WEE520
Posted: Nov 30, 2005 - 11:07 PM   
 
Hi all,
I experienced problems in losing connection with my 56F8356 microcontroller halfway through a debugging session many times. I also have seen CCSProtocolPlugin:Failed to stop process errors many times which is preventing me from breaking within my program to view debugging. What can be the causes of these problems and how I can prevent these from happening? Thanks a lot.
 
Regards,
Chee Wee 
 
 
  
cgates
Posted: Dec 01, 2005 - 01:42 PM   
 
This is the default error that occurs very frequently!
You didn’t state what your debug setup is, however if you are using the parallel port JTAG interface (such as a “wiggler”) then the single biggest issue I have found is the potential for a ground loop between your emulated device and the PC your are running the debugger on. Try “floating” your PC, which is easy to do if it is a laptop, (i.e. just unplug it), or opto–isolate the parallel port. So far I have not been able to find a commercially available optoisolator for the parallel port.
I have also killed a number of the parallel port wigglers as a result of heat! The moral is, be careful where you place the wiggler’s little box, it needs good airflow with room temperature air around it.
 
If you are using the USB HTAG emulator (i.e. USBTAP) then I would look for an optoisolated USB hub B&B makes one.
 
And lastly I have seen environmental electrical noise cause these errors as well. If you are trying to run the debugger in an industrial environment (as opposed to an office), that might be your problem. I actually had to move a production fixture that used the JTAG emulator out of a factory into a small shed next to the factory just to solve this issue!
 
Hope this helps,
Chris
Illuminati Engineering
 
0 Kudos

1,921 Views
marc_paquette
Contributor V
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
 
 
CCHEE WEE520
Posted: Nov 22, 2005 - 05:47 AM   
 
Hi all,
I am using MC56F8356 microcontroller and Codewarrior for 56800E v7.2 to develop the firmware. I would like to generate position independent codes that can be copied to Program RAM and run from Program RAM. Can this be done? Is it true that program codes can only be executed in Program memory only? Thank you for your help.
 
Regards,
Chee Wee 
 
 
 
MW_SMAUER
Posted: Nov 28, 2005 - 05:04 PM   
 
Hi Chee Wee,
 
The existing stationeries include examples of how to relocate code stored in Pflash to PRAM. However, it's still basically statically linked...you have to know the address in both areas of memory in advance. I've asked our compiler engineer about purely position independent code, and will relay his reply.
 
Regards,
Sccott 
 
 
  
cgates
Posted: Dec 01, 2005 - 02:07 PM   
 
Cchee,
 
Yes, execution of instructions can only take place from words fetched via the program bus (P space). This family of DSPs is a modified Harvard architecture (similar to an 8051 family member in that regard).
 
And “yes” it is possible to place instructions in P space RAM and run them dynamically.

Chris
Illuminati Engineering 
 
 
  
CCHEE WEE520
Posted: Dec 01, 2005 - 07:28 PM   
 
Hi Chris,
 
Thank you for your reply . As for the program codes being moved to PRAM and being executed from PRAM, do you have any suggestions on generating the position independent codes such that I can copy the required codes from Flash to PRAM and run the codes from PRAM? Thanks a lot.
 
Regards,
Chee Wee 
 
 
  
cgates
Posted: Dec 02, 2005 - 04:51 PM   
 
Hi Chee,
 
No not really.... I am kind of curious to see what SMAUER comes up with.
You could always code it in assembly with relative jumps and all, but I assume you are talking about more than a few statements of code, so it would be a significant effort.
 
Sorry,
Chris
 
 
 
0 Kudos