|
![]() Oscillators/PCA/Timers/SMBus/UART/SPI
![]() f340 SDCC PCA0MD watchdog
|
| next newest topic | next oldest topic |
| Author | Topic: f340 SDCC PCA0MD watchdog |
|
roodpart New Member |
Hi, I was wondering if someone could help me with this problem I'm having with the f340. I compile and run the blinky code with KEIL and it runs fine. I am aware that I need to use the following to disable the watchdog timer: unsigned char _sdcc_external_startup ( void ) But every time I check, PCA0MD remains 0x40 and RSTSRC=0x08, which means that the watchdog is still resetting the micro. Thanks. IP: Logged |
|
Tsuneo Member |
Is _sdcc_external_startup() placed with main() on the same file? Tsuneo [This message has been edited by Tsuneo (edited August 06, 2010).] IP: Logged |
|
roodpart New Member |
yes. this is all I have: #include "C8051F340.h" // Peripheral specific initialization functions, // Initialization function for device, char _sdcc_external_startup() void main(void) IP: Logged |
|
roodpart New Member |
Hmm. the problem seems to have gone away after moving the header file to the same directory. sorry and thanks for the help. IP: Logged |
|
vanmierlo Member |
#include "C8051F340.h" With quotes your including the header file from the current directory which might be for Keil only. With < > you should get the one from the SDCC distribution. But there's more. The latest IDE adds an extra search path to its own include directory and then even with < > SDCC might still use the Keil version. The problem with the Keil format for sfr definitions is that it reuses C syntax for assignment for setting the address of the sfr. SDCC happily accepts this assignment to the newly defined sfr variable which has no particular address and gets a random address from the linker. Maarten IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() |
|
Have you seen our MCU Knowledge Base?