Jump to content

TFcroft4

EstablishedMember
  • Content count

    36
  • Joined

  • Last visited

Community Reputation

0 Neutral

About TFcroft4

  • Rank
    Regular
  1. Thanks for the replies. I noted this text in the rs232_driver.h which specifically says software emulation. I am confused Ted //////////////////////////////////////////////////////////////////////////// // Serial Communications Library //////////////////////////////////////////////////////////////////////////// // Author(s): Andrew Smallridge // Date 15 November 2004 // // Copyright© 2004-2006 Andrew Smallridge // Copyright© 2004-2010 Pavel Baranov // Copyright© 2004-2010 David Hobday // Existing constants predefined for serial hardware driver and software // emulation for the PIC 16F87x, PIC18F2xx and 18F4xx processors. // For hardware support on other PICs the constants must be mapped to // the corresponding register map of the target device ////////////////////////////////////////////////////////////////////////////
  2. I would like to use 2 serial ports on a 16f877a. One would be receiving data from a GPS module at 9600 and I think would be better using the built in uart. The second is output only at 2400, sending a data packet of about 30 characters one a second Is this feasible and if so how would I set this up using the ScourceBoost UART template. Thanks
  3. TFcroft4

    Unresolved External Function

    OK - thanks. Using the Wizard helped although still not sure how I lost the 'connection' in the first place. Hey ho! Ted
  4. TFcroft4

    Unresolved External Function

    Are you building a custom version of the library or linking in a supplied version? Ether way this error means that linked can't find this function. Regards Dave I am using a supplied version - novolib_pic16t3e5ts1.lib - which is in c:\Program Files\SourceBoost\Lib I have solved this problem by using the Wizard to build a basic project and then imported my source code. I don't understand how the link to the library was lost though.
  5. TFcroft4

    Unresolved External Function

    Are you building a custom version of the library or linking in a supplied version? Ether way this error means that linked can't find this function. Regards Dave I am using a supplied version - novolib_pic16t3e5ts1.lib - which is in c:\Program Files\SourceBoost\Lib
  6. I have copied ( and possibly corrupted) a Novo project and am getting the following linker error. I think I have misplaced something! Any guidance would be welcomed. Thank Ted Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned short)' Error: Unresolved external symbol, function:SysiWaitSemaphore Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned short)' Error: Unresolved external symbol, function:SysiWaitSemaphore
  7. try this: I call this state based routine to parse the incoming NMEA characters for the RMC sentence once I know my GPS is up and running to get the time data I use the PPS as an interrupt to signal this, I then use the PPS to get accurate timing. This code can be adapted for other NMEA sentences. I also use an interrupt driven buffered serial routine - serHasData() checks to see if there is anything in the buffer. Note that the GPS will only give valid time when it has a fix. the A in field 2 indicates a valid time. char parse_RMC( char * buf){ //* Input $GPRMC,193418.00,A,5551.63161,N,00339.33683,W,0.023,,250709,,,A*6F char pos; char nmea_state=0; bool parsed_NMEA = FALSE; char gps_char; timeout = 10; // global second time out decreased in a timer ISR while ((parsed_NMEA==FALSE ) && (timeout > 0)) { if (serHasData()) { gps_char = serGetByte(); // read the character from the buffer // now try to see where this character fits in the NMEA RMC message we're trying to decipher switch ( nmea_state ) { case ( 0 ): // wait for '$' if ( gps_char == '$') nmea_state++; break; // case ( 1 ): // wait for 'R' if ( gps_char == 'R') nmea_state++; break; // case ( 2 ): // wait for 'M' if ( gps_char == 'M') nmea_state++; else nmea_state=0; break; // case ( 3 ): // wait for 'C' if ( gps_char == 'C') nmea_state++; else nmea_state=0; break; // case ( 4 ): if ( gps_char == ',')// wait for ',' after C { nmea_state++; pos=0;} else nmea_state=0; break; // state 5 , time comes next in 9 characters //Field 1 hhmmss.hh UTC time - // case ( 5 ): // wait for 6 time digits isdigit( char ch ) if ( isdigit (gps_char)) { buf[pos]=gps_char; pos++; if (pos==6) {nmea_state++;} } else {nmea_state=0;} break; // case ( 6 ): // wait for '.' if ( gps_char == '.') nmea_state++; else {nmea_state=0;} break; break; // case ( 7 ): // 2 .hh digits if ( isdigit (gps_char)) { buf[pos]=gps_char; pos++; if (pos==8) {nmea_state++;} } else {nmea_state=0;} break; // case ( 8 ): // wait for ',' end of time field if ( gps_char == ',') nmea_state++; else {nmea_state=0;} break; break; // case ( 9 ): // Status A valid V invalid if ( gps_char == 'A') { parsed_NMEA = TRUE; } else {nmea_state=0;} break; // if we have a valid time it is in buf and parsed_NMEA is TRUE default: mea_state = 0; // we should not end up here, but just in case we start again at the beginning break; } // end of switch gps_char=0; // reset input character } // end of if } // end of while return parsed_NMEA; } // end of while with time out // buf now has in ascii hhmmsshh // hours = (buf[0]-48)*10+(buf[1]-48) // mins = (buf[2]-48)*10+(buf[3]-48) // secs = (buf[4]-48)*10+(buf[5]-48) // hunds = (buf[6]-48)*10+(buf[7]-48) - normally zero Trimble have a code library that you can also use as a model but as it is not for an embedded target in needs a lot of stripping out. TRIMBLE NMEA Dev Kit
  8. Will this help? On the WIKI The Perfect Second There is a link to the Roman Black timing algorithm "www.RomanBlack.com Zero-error 1 second Timer A very versatile Zero Cumulative Error timing system with PIC source code Roman Black - orig June 2001 - update Aug 2006 - update 21 Nov 2009. What is it? Bresenham's Algorithm is a system where 2 imperfect periods can be alternated to produce an average that matches any "perfect" period. With most modern micros the easiest time period to generate is an overflow of the internal timer, generally 256 ticks or 65536 (256x256) ticks. Unfortunately, since most of these Micros run at crystal speeds like 4MHz and 20MHz, these overflow timed periods generated are binary and cannot be evenly divided into 1 second or any easily usable real-world clock value. Brilliant programmer Bob Ammerman recognised this fact and mentioned his use of a Bresenham-type system for PIC micros. Later I did some more work on the idea to speed-optimise it for the PIC timer0 overflow which is available on all PICs and release the results as public domain open source. It should also work on any other micro with a binary-multiple internal timer. " Ted
  9. I recently had to re insatall windows XP and hence all my applications. For SourceBoost once I had re instaled and also run the Registration programme I could not re build my project it was as though the registration had not worked. However by re-compiling all sources then re building all was fine. So the solution was re install, re register, re compile and then re build. Hope this helps. TF
  10. TFcroft4

    Interrupt Driven Clock

    A little time down the line - here is an update. The clocks ( 5 units ) run using NOVO RTOS with three tasks: Task1 - Called every second roll over - semaphore is set by an interrupt on Port B when GPS unit sends the PPS pulse, this resets a millisecond count and calculates the new values for the various time displays and also updates the LED displays. (If for any reason the GPS interrupt does not work then the TMR interrupt is used to set the semaphore when milliseconds reach 1000.) Task 2 - Called every 15 ms - Key board and LCD screen handler - polls the keypad every time the task runs and updates the LCD Screen on the Modtronix LCD2S . The screen handler is a finite state machine based on demo code that came with the Modtronix board - the only cost is that it uses a lot of code space to handle the multiple screen displays which are used to set various clock options e.g Daylight Saving Time. Task 3 - GPS synchronisation task - called once after all initialisations are complete but can also be called on demand by one of the menu options in Task 2. This task waits for standard NMEA messages either $GPZDA or $GPRMC, these give the current (UTC) time ( and date). These messages are parsed to extract the current time. The system clock and DS1307 RTC are updated with the current UTC time. One major headache was the GPS synchronisation hanging on some occasions when part of the initialisation routines. This seemed to be random but I now think was possibly caused by the serial output from the GPS, which starts immediately, not being serviced. The GPS unit used was EasyGPS board from http://www.mikroe.com/en/tools/gps/easygps/ - this is a complete board at a reasonable price rather than a module so saved having to build hardware except for interconnections. The GPS module is quite sensitive and picks up a reasonable number of satellites even indoors but near a window. By using the GPS pulse per second interrupt the 5 clocks are all synchronised to the GPS system. Thanks.
  11. If you are using V6.92 then this was indeed a problem that was introduced. This issue is resolved in V6.93. Regards Dave Thanks for the update - every little helps TF
  12. I have used this function and a similar one to swap bytes in a short - thanks.
  13. TFcroft4

    Ide Error Exit Code -1073741819

    This sounds like one that we would need a complete project that demonstrates the issue in order to find it.If you can please send the complete project to support@sourceboost.com. Regards Dave OK Thanks zip file on its way Ted
  14. TFcroft4

    Ide Error Exit Code -1073741819

    Building... BoostC Optimizing C Compiler Version 6.92 (for PIC16 architecture) http://www.sourceboost.com Copyright(C) 2004-2009 Pavel Baranov Copyright(C) 2004-2009 David Hobday Licensed to Edward Finch under Single user Full License for 1 node(s) Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only TFNovoClock0-1.c C:\Documents and Settings\Ted\My Documents\PIC\working\Mynovo\TFNovoClock0-1.c(382): WARNING: BIT4LO code included C:\Documents and Settings\Ted\My Documents\PIC\working\Mynovo\TFNovoClock0-1.c(407): WARNING: BIT4HI code included C:\Documents and Settings\Ted\My Documents\PIC\working\Mynovo\TFNovoClock0-1.c(418): WARNING: BIT5LO code included C:\Documents and Settings\Ted\My Documents\PIC\working\Mynovo\TFNovoClock0-1.c(428): WARNING: BIT5HI code included "C:\Program Files\SourceBoost\boostc.pic16.exe" TFNovoClock0-1.c -t PIC16F877A -Oa Exit code was -1073741819. Removing target: TFNovoClock0-1.obj Done I have reposted this in the Bug forum. Any thoughts on this error. Thanks
  15. Building... BoostC Optimizing C Compiler Version 6.92 (for PIC16 architecture) http://www.sourceboost.com Copyright(C) 2004-2009 Pavel Baranov Copyright(C) 2004-2009 David Hobday Licensed to Edward Finch under Single user Full License for 1 node(s) Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited, Non commercial use only TFNovoClock0-1.c C:\Documents and Settings\Ted\My Documents\PIC\working\Mynovo\TFNovoClock0-1.c(382): WARNING: BIT4LO code included C:\Documents and Settings\Ted\My Documents\PIC\working\Mynovo\TFNovoClock0-1.c(407): WARNING: BIT4HI code included C:\Documents and Settings\Ted\My Documents\PIC\working\Mynovo\TFNovoClock0-1.c(418): WARNING: BIT5LO code included C:\Documents and Settings\Ted\My Documents\PIC\working\Mynovo\TFNovoClock0-1.c(428): WARNING: BIT5HI code included "C:\Program Files\SourceBoost\boostc.pic16.exe" TFNovoClock0-1.c -t PIC16F877A -Oa Exit code was -1073741819. Removing target: TFNovoClock0-1.obj Done Building my project has given a memory access error and the "Exit code was -1073741819." I have been editing my main code file, trying to save RAM by moving strings to rom strings and progressively re building. Any thoughts. Thanks
×