This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Array initialization in c8051F320

I'm trying to fill an array in xdata with zeros as follows:

unsigned char n; //Index to scan the array
unsigned char xdata bt[100]; //The array to fill

for(n=0;n<100;n++){ bt[n]=0; }

But when the array size is bigger than 38 elements the MCU hangs.
Does anybody know the reason why this happens?

Parents
  • Hi Eric,
    I will try to avoid to trigger the black-listed word in this forum.
    Well, I have modified STARTUP.A51 including ASM instructions to disable WDT before the memory is allocated. Now everything seems to work fine, no more strange behaviour.
    I'm using 1K of XDATA, 128byte DATA and 128byte iDATA. I'm wondering if you can suggest some setting to gain access to USB 1K FIFO. F320 is quite powerful and despite it's age is still a winning choice against many other MCU thanks to the powerful peripherals such as ADC, DAC, PWM, SPI, and so on. However the RAM limitation still makes difference in some very specific cases. Having 2304byte of RAM would open the way to several additional applications.
    I've checked in the user manual and specs but I've not found any specific and explicit instruction to control the 1k FIFO. I understood that this memeory is fully controlled by USB logic hence it would be hard to control from 8051 core. There might be some instruction to push/pop data into FIFO, this could be useful but far away from a clasic RAM access operation.

Reply
  • Hi Eric,
    I will try to avoid to trigger the black-listed word in this forum.
    Well, I have modified STARTUP.A51 including ASM instructions to disable WDT before the memory is allocated. Now everything seems to work fine, no more strange behaviour.
    I'm using 1K of XDATA, 128byte DATA and 128byte iDATA. I'm wondering if you can suggest some setting to gain access to USB 1K FIFO. F320 is quite powerful and despite it's age is still a winning choice against many other MCU thanks to the powerful peripherals such as ADC, DAC, PWM, SPI, and so on. However the RAM limitation still makes difference in some very specific cases. Having 2304byte of RAM would open the way to several additional applications.
    I've checked in the user manual and specs but I've not found any specific and explicit instruction to control the 1k FIFO. I understood that this memeory is fully controlled by USB logic hence it would be hard to control from 8051 core. There might be some instruction to push/pop data into FIFO, this could be useful but far away from a clasic RAM access operation.

Children