Jump to content

ra68gi

EstablishedMember
  • Content Count

    229
  • Joined

  • Last visited

Everything posted by ra68gi

  1. /* BINARY COUNT This is a simple binary counting program that will light eight LEDs connected to portb pins of PIC16f84. The binary count program will light the LEDs in sequence from "0" to"255" incrementing by one. Each binary 1 in a number will be represented with a lit LED. Every 0.5 seconds the count is incremented. After reaching the binary number 255 ( the maximum byte value ), the sequence repeats, from zero. Before you load the hex file onto your chip, you can use the built in simulator on the SourceBoost IDE to check if your code is working just as intended.Read the IDE user's manual to get help to configure your plugins. Connections: pin4- MCLR pin to +5v via 4.7K resistor pin15-16 4mhz crystal(across pin 15 & 16) connect 22pf capacitors( between pin15 & gnd, pin16 & gnd) pin6-RB0-connect LED to pin6 via 470 ohms. Cathode of LED to gnd. pin7-RB1-connect LED to pin7 via 470 ohms. Cathode of LED to gnd. pin8-RB2-connect LED to pin8 via 470 ohms. Cathode of LED to gnd. pin9-RB3-connect LED to pin9 via 470 ohms. Cathode of LED to gnd. pin10-RB4-connect LED to pin10 via 470 ohms. Cathode of LED to gnd. pin11-RB5-connect LED to pin11 via 470 ohms. Cathode of LED to gnd. pin12-RB6-connect LED to pin12 via 470 ohms. Cathode of LED to gnd. pin13-RB7-connect LED to pin13 via 470 ohms. Cathode of LED to gnd. */ #include <system.h> #pragma CLOCK_FREQ 4000000 // config clock to 4mhz. // Set configuration fuse #pragma DATA _CONFIG, _XT_OSC & _WDT_OFF & _CP_OFF & _PWRTE_OFF void main() // Program entry point,mandatory for every C program. { trisb=0; // configure port B pins as output char b0; // Define b0 as character while(1) // Infinite loop { for(b0=0;b0<256;b0++) // For loop in C. See description below. { portb=b0; // Place b0 value at Portb to light LEDs. delay_ms(250); // Pause for 0.5 seconds & then go to display delay_ms(250); } // the next incremented b0 value. } // Because b0 has char data type it never reaches 256 // so this loop never exits. } /* In our second program BINARY COUNT, we see two new statements. The first is char b0;. b0 is a variable declared by us as character. In BoostC variables or data can be declared as bit, char, unsigned char, signed char, short, unsigned short, signed short, int ( integer ), unsigned int, signed int, long ( 32 bit data ), unsigned long, signed long. Please see BoostC user's manual for more info. The second statement is for(b0=0;b0<256;b0++). for is a loop control construct. It controls the number of times a block of statements is executed. The construct has an initial value, and a loop-count value that is incremented each time after the block is executed. This is similar to the Basic command "for x = 0 to 255". Program memory space used in this program is 31 words. */ PIC4.bmp
  2. /* WINK LED Our first c program.Blinking two LEDs on portb pin0 & pin1. Chip-16F84,8 i/o pins on portb & 5 i/o pins on porta. TO DO THIS PROJECT YOU REQUIRE.. 1. Source Boost(SB)IDE - FREE Down load is available from www.sourceboost.com 2. BoostC compiler - Comes along with the SB IDE 3. Take a print of the IDE user's manual and follow instructions. 4. Take a print of BoostC compiler reference manual. 5. PIC16F84 microcontroller & components listed below. 6. PIC16F84 data sheet available from microchip website. 7. Any PIC programmer. How to Build/compile your C Program? 1. Select tool suit, target chip and clock rate from settings in the toolbar & view the same on the source boost IDE status bar at the bottom of the screen. At this point your screen is blank. 2. First click the New button on the tool bar. 3. You can Copy & paste this code from this thread or type in the code as written below. 4. Now choose, save as & save your file. 5. Go to the project button on the toolbar. 6. Select the project you want to build by clicking on the appropriate file. In our case it is WINK LED. The sreen will go blank at this point. 7. Now your poject is selected and ready to build. 8. Now open the file again by clicking the file button or open button from the tool bar. 9. To cross check again if its the program you are going to compile, press the project button & see if the name of your file is right at the top of list of projects. 10.Now press Build button. If every thing works out well you can see success on your build/output window at the bottom of the IDE. How to check if your code is working? Before you load the hex file onto your chip, you can use the built in simulator on the SourceBoost IDE to check if your code is working just as intended.Read the IDE user's manual to get help to configure your plugins. Connections: pin4- MCLR pin to +5v via 4.7K resistor pin15-16 4mhz crystal(across pin 15 & 16) connect 22pf capacitors( between pin15 & gnd, pin16 & gnd) pin6-RB0-connect LED to pin6 via 470 ohms. Cathode of LED to gnd. pin7-RB1-connect LED to pin7 via 470 ohms. Cathode of LED to gnd. */ #include <system.h> #pragma CLOCK_FREQ 4000000 // config clock to 4mhz. // Set configuration fuse. #pragma DATA _CONFIG, _XT_OSC & _WDT_OFF & _CP_OFF & _PWRTE_OFF void main() { trisb = 0; //configure port B pins as output while( 1 ) //endless loop { portb.0=1; // set portb pin0 to high. portb.1=0; // set portb pin1 to low. delay_ms( 250 ); // pause 0.5 seconds delay_ms( 250 ); // (note we have to call delay_ms twice because it's // argument has unsigned char type) portb=0x02; // shows hex notation for entering data. delay_ms( 250 ); // you can also write portb=2 in decimal delay)ms( 250 ); } } /* The PIC 16F84 contains two I/O ports, portA & PortB. Each port has two registers associated with it, TRIS (Tri state) register and port register itself. The tris register controls whether a particular pin on a port is configured as input pin or output pin.Once the pins have been configured using tris register you may read or write data to the port using the port register. Writing a zero to a bit in tris register will make the corresponding bit or pin in port as output, capable of sourcing and sinking current. writing a one to a bit in tris register will make the corresponding pin in port as input. The microcontroller is capable of reading data placed on this pin. The same pin can be changed from input to output within a program by setting the tris register bit associated with it. In the above example we have entered zero into the trisb register there by making all the eight pins in portb as output. portb=255; will make all pins as input. You can also use binary notation to select individual bits for input or output. example: trisb = 0B10101011; . BoostC also allows us to choose individual bits in a register. example: trisb.0=0; makes portb pin0 as output. Once the pins have been configured as output, placing a one in the port register will make it high(+5v) & placing a zero in the port register will make it low(0v, capable of sinking 25ma current). I am really amazed by the compact code size generated by this compiler. It takes just 34 words of program memory space comp- ared to 54 words by PicBasicPro and 70 words by mikroC. */ pic_project.bmp
  3. " Please don't reply to this thread" Hello friends, This thread is started with the intension of providing quick start to beginners in programming PIC microcontrollers using BoostC compiler. All code examples have been tested by me either using the simulator or by hard wiring the device. Who will benefit from this thread? 1. Absolute beginners. 2. Those wanting to migrate from other compilers/languages like PicBasic,PicPascal, etc. If you have suggestions or questions please post it on a new thread. Raghunathan
  4. Freek, This is one of the common mistake most first time users do in SB IDE. I do the following steps to edit old files. 1. First click the file button on the tool bar and select the file you want to edit. 2. After editing the file save it. 3. Now close all files on the window. 4. Goto the project button on the toolbar. 5. select the project you want to build by clicking on the appropriate file. 6. Now your poject is selected and ready for build. 7. make sure about the tool suite and target chip by looking at the bottom of the source boost IDE status bar. at this point your window is blank. 8. Now select the file again clicking the file button or open button from the tool bar. 9. To cross check again if its the program you are going to compile, press the project button & see if the name of your file is right at the top of the list of project. 10. Now press Build button. One more suggestion, Take a printout of source boost IDE user's manual and the compiler reference manual. They are really very useful.
  5. <{POST_SNAPBACK}> Yes Picxie, you are right. Raghunathan
  6. Why is the C files in source boost IDE hi-lighted as mikroC source file and not BoostC source file? Raghunathan.
  7. Hi Guys, In the terminal screen of source boost IDE is there only one screen for both receive and sending data? To send data should i have to first clear the received message on the screen then type in the send data and press enter key? Raghunathan.
  8. Hi Guys, Thanks very much for keeping this thread active with your suggestions and ideas. I thought i can come up with all my doubts in this thread and finally post the successfuly working and tested codes ( only on boostc compiler) on another new thread by name say " sample code for beginners ". It is intended for those with with very little or no knowledge of c programming. Do you guys support this? I think, i might also require the consent of the forum administrator (Pavel & Dave). Thanks, Rahunathan.
  9. I think you might find its actually: units=(number%10); tens=(number%100)/10; hundreds=number/100; Regards Dave <{POST_SNAPBACK}> Actually both are right. Lets say the number is 987. hundreds = 987/100 = 9 tens = (987%100)/10 = 87/10 = 8 units= (87)%10 = 7 Raghunathan
  10. <{POST_SNAPBACK}> I was just wanting to say that. Hi lighting the error in code and suggesting the right syntax will be of great help. Raghunathan
  11. Hi Picxie, I think its, hundreds=number/100; tens=(number%100)/10; units=(number%100)%10; Regards Raghunathan
  12. Thanks very much for your help. Really my first code was compiling. Can you guess what was wrong in the code? i wrote if (portb=0), instead of if (portb==0). My main reason to migrate from basic compiler is that most rtos supports only c and am bent on implementing rtos in my robot projects which i have been constructing using pic basic. Raghunathan.
  13. Hi Guys, I am new to c programming. I am only familiar with PIC basic and bascom. Since boost c compiler is very affordable compared to most other compiler i wanted to start learning c. I have a small program, which does a binary progression and displays on portb. the problem is that my pogram does not jump to the check subroutine or function that i call from the main program. Please help. #include <system.h> #pragma CLOCK_FREQ 4000000 // Set configuration word #pragma DATA _CONFIG, _XT_OSC & _WDT_OFF & _CP_OFF & _PWRTE_OFF void check() { if(portb=0) { portb=1; delay_ms(500); } } void main() { trisb=0; portb=0; while(1) { check(); portb *= 2; delay_ms(500); } } Can the check routine be placed after the main routine? when i tried it , it gives a compilation error, " not able to find label check" or some thing like that.
  14. Hi Dave, I am getting error when i use integer divide operator "\". #pragma DATA _CONFIG, _WDT_OFF & _XT_OSC & _CP_OFF & _PWRTE_OFF 'portb pins gives BCD out to be viewed in simulator dim tens as byte, units as byte sub main() trisb=0 dim z as byte,y as byte do while true for y=0 to 99 tens = y \ 10 units=y Mod 10 tens=tens*16 portb=units+tens call delay_ms(500) next y loop end sub Building... BoostBasic Optimizing Basic Compiler Version 6.55 Beta (for PIC16 architecture) http://www.sourceboost.com Copyright© 2004-2006 Pavel Baranov Copyright© 2004-2006 David Hobday Beta version. No limitations. Expire date: 2007.01.01 _.bas SB_BCD_0_TO_99.bas(10): error: general error failure Exit code was 1. Removing target: _.obj SB_BCD_0_TO_99.bas(10): error: failure Failed to locate output file '_.obj' Done Failed But it compiles well with floating point divide operator "/". in the above code if i changed it to tens = y / 10 '"/" works but not "\" it works. what might be the problem. Raghunathan
  15. Hi Dave, When i build your nova c program, i get errors. Why? /////////////////////////////////////////////// // Portb sharing using a semaphore /////////////////////////////////////////////// // Uses Novo RTOS // // This has two tasks. They both share PORTB for // output. A semaphore is used in binary mode to // ensure that only one task is using PORTB at a // time // // Target Device: PIC16F88 // // Author: David Hobday // // Version History: // V1.0 - 19/09/2006 // Initial release. #include <system.h> #include <novocfg_pic16t3e5ts1.h> #include <novo.h> #pragma DATA _CONFIG, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_OFF & _WDT_OFF & _HS_OSC #define hTask0 0 #define hTask1 1 #define hSemaPortbAvailable 0 void interrupt( void ) { // update system time every 1ms (actually is 204.8us x 5 = 1.024ms) static BYTE intDivider; if( ++intDivider == 5 ) { intDivider = 0; SysTimerUpdate(); } intcon.TMR0IF = 0; //clear TMR0 overflow flag } void InitTimer() { // configure Timer0 option_reg.T0CS = 0; // use internal clock option_reg.PSA = 0; // use prescaler form timer 0 // so we get an interrupt around every 204.8us with 20MHz Clock // set prescaller to divide by 4 option_reg.PS0 = 1; option_reg.PS1 = 0; option_reg.PS2 = 0; // enable interrupts intcon.TMR0IE = 1; //enable TMR0 overflow bit intcon.GIE = 1; } void Task0() { while( 1 ) { Sys_WaitSemaphore( hSemaPortbAvailable, EVENT_NO_TIMEOUT ); portb = 0b00000000; Sys_Sleep( 255 ); portb = 0b10000001; Sys_Sleep( 255 ); portb = 0b01000010; Sys_Sleep( 255 ); portb = 0b00100100; Sys_Sleep( 255 ); portb = 0b00011000; Sys_Sleep( 255 ); SysSignalSemaphore( hSemaPortbAvailable ); Sys_Yield(); } } void Task1() { while( 1 ) { Sys_WaitSemaphore( hSemaPortbAvailable, EVENT_NO_TIMEOUT ); BYTE i; for( i = 0; i < 5; i++ ) { portb = 0b01010101; Sys_Sleep( 255 ); portb = 0b10101010; Sys_Sleep( 255 ); } SysSignalSemaphore( hSemaPortbAvailable ); Sys_Yield(); } } void main() { ansel = 0; trisb = 0x00; InitTimer(); SysInit(); SysCreateTask( hTask0, 2, Task0 ); SysCreateTask( hTask1, 2, Task1 ); SysSignalSemaphore( hSemaPortbAvailable ); // allow initial use of portb // Task0 will be the first to run as it was started first and // both tasks have equal priority. Neither task will run however until // we executed the first yielding instruction. SysStartTask( hTask0 ); SysStartTask( hTask1 ); while( 1 ) { Sys_Yield(); } } Building... BoostC Optimizing C Compiler Version 6.55 (for PIC16 architecture) http://www.sourceboost.com Copyright© 2004-2006 Pavel Baranov Copyright© 2004-2006 David Hobday Single user Lite License (Unregistered) for 0 node(s) Limitations: PIC12,PIC16 max code size:2048 words, max RAM banks:2, Non commercial use only NovoBinarySemaphore.c success BoostLink Optimizing Linker Version 6.55 http://www.sourceboost.com Copyright© 2004-2006 Pavel Baranov Copyright© 2004-2006 David Hobday Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external function:'SysStartTask(unsigned char)' Error: Unresolved external function:'SysStartTask(unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external function:'SysStartTask(unsigned char)' Error: Unresolved external function:'SysStartTask(unsigned char)' Error: Unresolved external function:'SysTimerUpdate(void)' Error: Unresolved external symbol, function:SysTimerUpdate Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiWaitSemaphore Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external symbol, function:SysiUnlinkFromQueue Error: Unresolved external function:'SysiFindLastHpTask(void)' Error: Unresolved external symbol, function:SysiFindLastHpTask Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiAddToSleepQueue Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external symbol, function:SysiUnlinkFromQueue Error: Unresolved external function:'SysiFindLastHpTask(void)' Error: Unresolved external symbol, function:SysiFindLastHpTask Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiAddToSleepQueue Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external symbol, function:SysiUnlinkFromQueue Error: Unresolved external function:'SysiFindLastHpTask(void)' Error: Unresolved external symbol, function:SysiFindLastHpTask Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiAddToSleepQueue Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external symbol, function:SysiUnlinkFromQueue Error: Unresolved external function:' Failure "D:\Program Files\SourceBoost\boostc.pic16.exe" NovoBinarySemaphore.c -t PIC16F88 "D:\Program Files\SourceBoost\boostlink.pic.exe" /ld "D:\Program Files\SourceBoost\lib" libc.pic16.lib NovoBinarySemaphore.obj /t PIC16F88 /d "D:\Program Files\SourceBoost\Samples\C\BoostC\novo" /p NovoBinarySemaphore Exit code was -2. Removing target: NovoBinarySemaphore.hex SysiFindLastHpTask(void)' Error: Unresolved external symbol, function:SysiFindLastHpTask Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiAddToSleepQueue Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external symbol, function:SysiUnlinkFromQueue Error: Unresolved external function:'SysiFindLastHpTask(void)' Error: Unresolved external symbol, function:SysiFindLastHpTask Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiAddToSleepQueue Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external symbol, function:SysiSignalSemaphore Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiWaitSemaphore(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiWaitSemaphore Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external symbol, function:SysiUnlinkFromQueue Error: Unresolved external function:'SysiFindLastHpTask(void)' Error: Unresolved external symbol, function:SysiFindLastHpTask Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiAddToSleepQueue Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiUnlinkFromQueue(unsigned char)' Error: Unresolved external symbol, function:SysiUnlinkFromQueue Error: Unresolved external function:'SysiFindLastHpTask(void)' Error: Unresolved external symbol, function:SysiFindLastHpTask Error: Unresolved external function:'SysiAddToSleepQueue(unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiAddToSleepQueue Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external symbol, function:SysiSignalSemaphore Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Error: Unresolved external function:'SysInit(void)' Error: Unresolved external symbol, function:SysInit Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiCreateTask Error: Unresolved external function:'SysiCreateTask(unsigned char,unsigned char,unsigned char)' Error: Unresolved external symbol, function:SysiCreateTask Error: Unresolved external function:'SysiSignalSemaphore(unsigned char)' Error: Unresolved external symbol, function:SysiSignalSemaphore Error: Unresolved external function:'SysStartTask(unsigned char)' Error: Unresolved external symbol, function:SysStartTask Error: Unresolved external function:'SysStartTask(unsigned char)' Error: Unresolved external symbol, function:SysStartTask Error: Unresolved external function:'Sys_Yield(void)' Error: Unresolved external symbol, function:Sys_Yield Failed to locate output file 'D:\Program Files\SourceBoost\Samples\C\BoostC\novo\NovoBinarySemaphore.hex' Done Failed
  16. Hi Dave, Can we implement novo rtos in boost basic? I understand that boostc and boost basic both use the same linker to generate the hex file. I also understand that the -swcs( software call stack) switch has to be set in order to use novo rtos ie. to say all call functions containing novo rtos's sys_yield() function will use software call stacks. Am i right? Is it poosible to use the demo free down load to test it? In the SB IDE is there any settings to invoke nova rtos. I want to get started with rtos. What are the tools i need to buy, min chip requirement, a writeup on rtos would be of great help for beginners like me. Regards Raghunathan Note from Dave:I move this text into a new thread as the old one was getting looooong and we had moved off the original subject
  17. Hi Dave, I have mailed the schematic, code and a writeup to support@sourceboost.com. I have also sent a mpeg file of the working robot in action. Regards Raghunathan. <{POST_SNAPBACK}> Hello Dave, Did you receive my mail? Raghunathan.
  18. Hi Dave, I have mailed the schematic, code and a writeup to support@sourceboost.com. I have also sent a mpeg file of the working robot in action. Regards Raghunathan.
  19. Dave, How do i set the watch dog timer in BB? will the compiler automatically reset the WDT. When i set the #pragma with the WDT_ON i don't see any increment in code compiled. So do we have to manually reset it? And if its ON what is the prescaler assigned to? #pragma DATA _CONFIG, _WDT_ON & _XT_OSC & _LVP_OFF & _CP_OFF & _PWRTE_ON I think PWRTE is power on reset. Am i right? And what if its ON? I generally keep it ON in the PIC basic compiler. Raghunathan
  20. [. You don't need to know asm to right libraries, it can be done in C (or in fact BoostBasic, but that doesn't work at the moment). Some of the existing library code should be useable already. We do need to press forwards and get it working with BoostBasic. Send a mail to support@sourceboost.com and we can start discussions. Hi Dave, I have written a program for a line tracking robot, which is driven by 2 continuous servo motor. It has a line tracking sensor which detects a black line on a white surface and sends a signal to portb.0. The microcontroller sees this black line and turns the servo in such a way as to get off the black line. once outside the black line it tries to get back and so on . In this way it moves forward following the black track. If you are interested i can send the schematic and mpeg of the working model and you may post it on your web site. Please let me know. In one of the previous threads tim had asked for pulsout command. I tried to create a lib for for it in BB as call pulseout(pin,duration). I found my code space or memory space increases by using lib. Is it some thing we need to pay for. for using easy to use lib? code for line tracking robot #pragma DATA _CONFIG, _WDT_OFF & _HS_OSC & _LVP_OFF & _CP_OFF & _PWRTE_OFF sub main() trisb=1 portb=0 do while true if portb.0=0 then 'read the line tracking sensor. if the sensor outs a zero, then the call right_servo() 'sensor is over the black line & so rotate the right servo. else 'if portb.0 is a one, then the sensor is over the white surface & so call left_servo() 'make the left servo motor to rotate. end if loop 'do it all again end sub sub right_servo() 'driving a continuous rotation servo motor with 1.5ms pulse with a dim x as byte 'period of 50hz to 60hz will stop the motor while 2ms pulse will make for x= 0 to 2 'it rotate in clockwise & 1ms pulse anticlockwise. portb.4=1 call delay_10us(150) portb.4=0 portb.5=1 call delay_ms(2) portb.5=0 call delay_ms(18) 'This delay keeps the pulse frequency at around 50hz. next x end sub sub left_servo() dim x as byte for x=0 to 2 portb.4=1 call delay_ms(1) portb.4=0 portb.5=1 call delay_10us(150) portb.5=0 call delay_ms(18) next x end sub Building... BoostBasic Optimizing Basic Compiler Version 6.55 Beta (for PIC16 architecture) http://www.sourceboost.com Copyright© 2004-2006 Pavel Baranov Copyright© 2004-2006 David Hobday Beta version. No limitations. Expire date: 2007.01.01 _.bas success BoostLink Optimizing Linker Version 6.55 http://www.sourceboost.com Copyright© 2004-2006 Pavel Baranov Copyright© 2004-2006 David Hobday Caution: argument of 'delay_10us' calls must have a value of 1 or more Building CASM file Memory Usage Report =================== RAM available:256 bytes, used:3 bytes (1.2%), free:253 bytes (98.8%), Heap size:253 bytes, Heap max single alloc:95 bytes ROM available:4096 words, used:92 words (2.3%), free:4004 words (97.7%) Successful Done The same program with Pulseout(pin, duration) command #pragma DATA _CONFIG, _WDT_OFF & _HS_OSC & _LVP_OFF & _CP_OFF & _PWRTE_OFF sub main() trisb=1 portb=0 do while true if portb.0=0 then 'read the line tracking sensor. if the sensor outs a zero, then the call right_servo() 'sensor is over the black line & so rotate the right servo. else 'if portb.0 is a one, then the sensor is over the white surface & so call left_servo() 'make the left servo motor to rotate. end if loop 'do it all again end sub sub right_servo() 'driving a continuous rotation servo motor with 1.5ms pulse with a dim x as byte 'period of 50hz to 60hz will stop the motor while 2ms pulse will make for x= 0 to 2 'it rotate in clockwise & 1ms pulse anticlockwise. call pulseout(4,150) call pulseout(5,200) call delay_ms(18) 'This delay keeps the pulse frequency at around 50hz. next x end sub sub left_servo() dim x as byte for x=0 to 2 call pulseout(4,100) call pulseout(5,150) call delay_ms(18) next x end sub sub pulseout(pin as byte, duration as byte) dim pin as byte dim duration as byte if pin=0 then portb.0=1 elseif pin=1 then portb.1=1 elseif pin=2 then portb.2=1 elseif pin=3 then portb.3=1 elseif pin=4 then portb.4=1 elseif pin=5 then portb.5=1 elseif pin=6 then portb.6=1 elseif pin=7 then portb.7=1 end if call delay_10us(duration) if pin=0 then portb.0=0 elseif pin=1 then portb.1=0 elseif pin=2 then portb.2=0 elseif pin=3 then portb.3=0 elseif pin=4 then portb.4=0 elseif pin=5 then portb.5=0 elseif pin=6 then portb.6=0 elseif pin=7 then portb.7=0 end if end sub Building... BoostBasic Optimizing Basic Compiler Version 6.55 Beta (for PIC16 architecture) http://www.sourceboost.com Copyright© 2004-2006 Pavel Baranov Copyright© 2004-2006 David Hobday Beta version. No limitations. Expire date: 2007.01.01 _.bas success BoostLink Optimizing Linker Version 6.55 http://www.sourceboost.com Copyright© 2004-2006 Pavel Baranov Copyright© 2004-2006 David Hobday Caution: argument of 'delay_10us' calls must have a value of 1 or more Building CASM file Memory Usage Report =================== RAM available:256 bytes, used:5 bytes (2.0%), free:251 bytes (98.0%), Heap size:251 bytes, Heap max single alloc:95 bytes ROM available:4096 words, used:184 words (4.5%), free:3912 words (95.5%) Successful Done Regards Raghunathan
  21. Hi Dave, I would love to contribute in making the library, but i don't know asm right now, so i don't think i can be of much help. I can probably write simple basic programs for led, keys, key pad, 7-segment display, serial communication, spi, i2c,with the already existing lib, some stepper motor, servo motor example, simple robot project like a line tracking robot etc. If that's going to be useful i may be of some use. Please let me know. Regarding Programming... Do we have gosub and return commands in BB? In PIC BASIC and BASCOM we have gosub's directed to specific lables, which ends with a return statement. I have written a sample code using BB style of using subroutines. #pragma DATA _CONFIG, _WDT_OFF & _HS_OSC & _LVP_OFF & _CP_OFF & _PWRTE_OFF sub main () trisb = 0 DO while true call BINARY_COUNT () LOOP end sub sub BINARY_COUNT () dim x as byte FOR x=0 TO 255 portb = x call delay_ms(30) NEXT x end sub Is this the only way to GO...? Raghunathan
  22. Hi Dave, Boost basic has really got a nice simulator. I was able to watch the led block plugin, the assemly code window and the variable window update as the code was stepped thro'/ run. One problem i found was the the variables showed error when ever it encountered the delay command while i stepped thro' the code. With the program running the variables kept on showing error. Why does this happen? Is it possible to get the assembly code screen in the debug mode to full size so that i can watch more lines? At the bottom of the window there is the tick window . Does it indicate system frequency ie. crystal freq/4 ? I found that the tick starts with a value of 44us. Why is it ? Also i found that to execute the basic command trisb=0 it takes 12us , i=1 takes 12us, do while i>0 takes 16us. Does it take so long. Is the the basic code execution in synch with the tick indicated below? You have got really nice plugins but i would also like to have a plain 7-segment display without the bcd conversion. preferably common cathode. What i meant by Boost basic commands are library function like 1. delay_ms 2. LCD (Single line lcd command for a string of characters) 3. serial_out or put ( for software serial communication) 4.lookup_table 5. I2C read 6. I2C write 7. Hserial (hard ware serial communication) 8. ADC ( a to d conversion0 9. Button ( button command with debounce) 10. Branch 11. PWM ( generates pwm on pin) I would also like to have a list of math operators, for ex. Division / ? remainder // ? Shift rotate cose sine sqr bitwise operators ? comparison, logical operators? long? single? Those pertaining to Boost basic and not VB in general. A good list of library will make life easy. I dont see any reason why one should spend a lot of time rediscovering and creating these libs oneself when many of the commercial compilers have already got. Raghunathan
  23. Hi Dave, I have a few doubts regarding the simulator. Dave, can i not see the values of variables and register change when i press the run key? I can only see the LEDs change in the LED block. Yes it does change when i step thro' the code but not when i run. Again i don't understand the watch plug in. I see only a white screen. I presume it is meant for watching the variables declared by us in the program, but i can't type anything on to it either. Dave, do we have a list of commands for Boost Basic or can we use the same used in Boost C? I don't know C but will take try with Boost C. Raghunathan.
  24. Sound like its not been compiled and linked, its the linking process that creates the .hex and cod/coff (debug files).Try using the 'B' (Build) button on the tool bar. It complies what needs compiling and link the code. Regards Dave <{POST_SNAPBACK}> Dave, Iam sorry. Now i got it right. I had written SUB MAIN() in my code and when i changed it to SUB main() it worked. Thanks Raghunathan.
×
×
  • Create New...