Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Electro-dan

  • Rank
  1. I just noticed something else too. In my new piece of code: delay_us(228); delay_us(250); I took out the line delay_us(250); and those last four warnings have gone away! I'll do more research into this later - but I can't program the PIC yet because I am currently using the preamp it is in for music! Cheers,
  2. Well, the compiler I use is the C2C compiler, and I use the SourceBoost IDE. I thought C2C was the main compiler rather than BoostC? The warnings seem to apply to this part of the code... // Define device config block asm { list p=16F877A __config H'3F71';PROTECT50&XT&WDTDIS&PWRTEN&BORDIS&LVPDIS&DUNPROT&WRTEN&DEBUGDIS } This does work, and is supported by the C2C compiler (in fact, it is generated by the new project wizard). The warnings don't appear to occur when I comment that block of code out, but the compiler still takes a second or more longer than it should to complete the task, I am also getting some new warnings too... Message: Built-in variables are obsolete. Use variables defined inside the system header file Warning: Not known opcode 'list p=16F877A' Warning: Not known opcode '__config H'3F71' ;PROTECT50&XT&W...' Warning: Timing in '_delay_us' is wrong because of extra 'page' instructions Warning: Timing in '_delay_us' is wrong because of extra 'page' instructions The last two are new - and I am not sure what they mean either! Cheers,
  3. Hi there, I seem to have an odd error which is preventing me from allowing my code to have extra functions. Before this problem, everything was fine, and my hex output file was about 11k (or 5.5k on the processor). Now I have added some extra code, there are some warnings saying: Warning: Not known opcode 'list p=16F877A' Warning: Not known opcode '__config H'3F71' ;PROTECT50&XT&W...' When this occurs, my an asm file is made and this assembles into a hex file ok, which is 13.1k. But when I run the PIC, it seems to repeat the intialisation procedure constantly, and not do as it is told! This problem seems to appear when I get those warnings above, and also note the compiler seems to take about 2-3 seconds longer doing its work on an Athlon XP 2800+ system (so I don't know what it is doing) As far as I know, there are no code restriction - I have the full single user license. I am using one big C file that was initially created by the wizard, so I have the piccode addons too. If anyones knows what is going on, let me know! Cheers,
  4. Ah ok, I never knew that! I just use ICProg to program the PIC and it seems to do it whatever the code size (although I don't think I have gone above twice the size I can actually use). It is interesting to know this actually because I have a large project that uses two 8k PIC processors with HEX files 10.3K each, so actually I could go to 16K? Anyway, I'll have another look through the code and try to find out where the problem is laying... I think it is because the interrupt routine takes longer to happen then for tmr0 to interrrupt again because of the 100ms delay. Many Thanks,
  5. Hello there, I noticed in the examples section of the C2C site there is an example using a DS1821 to measure a temperature and a voice chip to output the temperature, plus warnings etc. It is labelled " This project (with circuit) created with ISD2560 record and playback chip, DS1821 temperature sensor, PIC16F84 with circuit for sightless Voice Termometer, fire and gas alarm system (by Ayhan Dayanik):". Unfortunately his email no longer exists so I cannot contact him directly. I have tried to get my DS1821 to work using the ds1821.c and ds1821.h files and writing my own main program to check the temperature on every 256th interrupt and output it to a two digit (multiplexed) LED display. I'm using a 4511 chip to decode the BCD output from the PIC... However, I have a problem. Its not working. I'm usually quite good at finding out why, but the errors are quite strange and I looked at the size of the assembled HEX file and it is 1.98KB. Obviously too big for the PIC16F84A. The example uses this chip, or the PIC16C84 version of it which also only has 1K of flash/rom memory (I think). So, I am just wondering really how that example managed to get temperature measurements, and voice output all onto a 1K microprocessor using the C2C compiler... maybe I have the settings wrong after all this time of writing programs in it? My options have set to maximise instruction optimising and I am calling the assembler using D:\MYDOCU~1\PIC\MPASMWIN.EXE /aINHX8M /p%target% /rHEX /w2 /q (which is default). I'm using the SourceBoost IDE with the C2C compiler (not BoostC). Snipets of my code: on_init() DS1821_Start(); DS1821_TermometerMode(); tmr_0() void on_timer0( void ) { //TODO: add your timer 0 code here temp = Temp_Measure(); if (porta & 4) clear_bit(porta, 2); else set_bit(porta, 2); } on_idle() void on_idle( void ) { //TODO: add your idle code here clear_wdt(); out1 = temp/10; out2 = temp%10; portb = out1 + 16; delay_ms(10); portb = out2; delay_ms(10); } And thats pretty much it - much simpler than the example as I have no other interrupts (currently) and no voice output either! Its confuses me why this should be nearly 2K Any ideas would be nice if thats ok? Many Thanks,
  • Create New...