Jump to content

dmb

EstablishedMember
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About dmb

  • Rank
    Newbrie
  1. dmb

    PIC18

    Any idea when these pic 18 will be included? Is current version workable for pic18 if i write the TDF file?
  2. Is there a way to see if the processor rebooted because of hardware reset or by the watchdog? can i combine time for watchdog en serial interrupt driven tx? xtal =20mhz, serial rate = 38400 Thanks, dmb
  3. I use 24c04 eeprom. pin 7 to gnd, bytewrite should work. i can read it, can program it with a programmer. but when i want to write it by pic, it fails (old data is still in) code: Sendstart(); // open i2c bus Sendbyte(0xA0); // i2c adres for eeprom Sendbyte(0x00); // first byte in eeprom Sendbyte(0xC0); // data to put in eeprom, byte 0 Sendstop(); // close bus Any thoughts? DMB
  4. i use this in a commerial product, same time as a i2c master (bitbanging) serial port (embedded), and a second tx (bitbang). although you might expect i2cslave to be the hardest one to implement, it is not. Setting up registers as in microchip documentation works fine. I made an array for the registers, inclusive autoincrement etc. I can not send you the code but if you need help, please mail me the specific questions.
  5. i have to divide a 32 bit (40000000h) by 16 bits, need a 24bit result... does anyone have some working sample code?
  6. after upgrading to 4.5.4 included def.h seems not be working anymore... it asumes the def.h in the c2c\include directory i am doubting regarding registering... i still have some troubles but fixing the buggy register settings as in 4.5.4 should solve a lot of those.. when i register now? what will upgrade to 5.0 cost in future? when i wait, what will version 5 cost then. i work on 2 computers (office and home), can i register 1 key on both machines?? can i translate this compiler into dutch?
  7. i used it but the embedded faulty register have priority so this was not helpfull so far only way was changing is to eeecon1 etc
  8. the example you give uses _eecon1 etc... if EECON1 would be right defined on each target pic all examples would work fine, even designed for other compilers or from the microchip application nodes...
  9. i changed eecon to eeecon in both the declarations and functions and now it is fine.. it should not use the standard defeined registers if the target choosen is not using this registers..!
  10. char eecon1@0x018C; char eecon2@0x018D; // EECON1 Bits #define EEPGD 0x0007 #define WRERR 0x0003 #define WREN 0x0002 #define WR 0x0001 #define RD 0x0000 code: void write_eeprom ( unsigned char addr, unsigned char eepdata ) { while ( EECON1 & 0x02);// was & WR eeadr = addr; eedata = eepdata; clear_bit ( EECON1, EEPGD ); set_bit ( EECON1, WREN ); clear_bit (INTCON, GIE); EECON2 = 0x55; EECON2 = 0xAA; set_bit( EECON1, WR ); // write command set_bit (INTCON, GIE); // reenable interupts clear_bit( EECON1, WREN ); // inhibit further writing
  11. when i code for eecon1 the compiler chooses the wrong bank (2 instead of 3 i believe) so i decided to write this part is asm... and i wrote asm{ bsf STATUS,RP0 bsf STATUS,RP1 bcssf EECON1,WR ? after building the lst file gives... bsf STATUS,RP0 bsf STATUS,RP1 bsf STATUS,RP1 bcf STATUS,RP0 bcssf EECON1,WR so 2 questions: 1, why is compiler adding lines when writing parts in asm? 2, why is the wrong bank choosen for eecon1? Thanks in advance
  12. If i use if(1) option=1; in main.c, all fine if i use this line in a sub.c called from main, it gives a general failure during compiling.. what could be wrong
×
×
  • Create New...