port stack

for simulating demo code of AVR323, port stack error comes. error is "error:[pe020] : identifier portSTACK_TYPE is undefined"

port stack

The ATMega323 code can be simulated in AVRStudio successfully.  Your error sounds more like a compilation error than a simulation error.  How are you simulating the code?