??? 05/13/05 10:35 Read: times |
#93382 - differents Responding to: ???'s previous message |
hi,
Rob Woodhouse said:
...also reset is connected to vcc via a 10uF capacitor, and when we want to enter bootloaded (after connecting PSEN to gnd), we connect RESET straight to vcc via a jumper (shorts out the cap) and then take off the jumper of both reset and PSEN. This allows us to enter bootloader mode and program the device in Flip. If this didnt work - we wouldnt be able to program the device, which we can.
Well, it may not be a reason of your problem but I still strongly recommend to use external power supervisor for reset. Here is from CC01 datasheet: ============================================Reset Recommendation to Prevent Flash Corruption An example of bad initialization situation may occur in an instance where the bit ENBOOT in AUXR1 register is initialized from the hardware bit BLJB upon reset. Since this bit allows mapping of the bootloader in the code area, a reset failure can be critical. If one wants the ENBOOT cleared in order to unmap the boot from the code area (yet due to a bad reset) the bit ENBOOT in SFRs may be set. If the value of Program Counter is accidently in the range of the boot memory addresses then a flash access (write or erase) may corrupt the Flash on-chip memory. It is recommended to use an external reset circuitry featuring power supply monitoring to prevent system malfunction during periods of insufficient power supply voltage (power supply failure, power supply switched off). ============================================ Any suggestions???? Could it be something in our software, causing the program to stop working when we attach the CAN wires or could it be hardware? Thanks... Well, try to analyze what are differences between just "Start App" and "Start App with reset". I have a look at CC01 bootloader and found how it does both starts. Here is the part of this code: hex_start_application: mov A,hex_buffer+1 jz hex_hardware_reset mov DPH,hex_buffer+2 mov DPL,hex_buffer+3 clr A jmp @A + DPTR hex_hardware_reset: mov WDTRST,#01Eh mov WDTRST,#0E1h hex_wait_reset: ajmp hex_wait_reset As you may see, "Start App" just does LJMP to specified address (here it is 0x0000). "Start App with reset" does start watchdog and waits till timer resets MCU itself. Now we know how. So we trying find differences. The main differene I see is that "Start App" does not set hardware to defined reset conditions. The main important things are: - timer 2 is run as baudrate generator and UART is on as well; - stack pointer is set to somewhere; - bootloader is mapped into code space. - a couple of SFRs are in not defined state (including, AUXR, AUXR1, FCON, EECON and some others). Check all above in your program for correct usage. For example, check for correct stack pointer initialization, EEPROM usage, timer 2 utilization etc. Regards, Oleg |
Topic | Author | Date |
Problem Programming ATMEL T89C51CC01 | 01/01/70 00:00 | |
more details needed | 01/01/70 00:00 | |
Program works until CAN is connected | 01/01/70 00:00 | |
differents![]() | 01/01/70 00:00 |