
Reynard
EstablishedMember-
Content Count
688 -
Joined
-
Last visited
Everything posted by Reynard
-
Code Generated Looks Weird
Reynard replied to TomF's topic in BoostC and Chameleon compilers programming
Hi Tom, I think you have some interger promotion going on here. Try this casting: osccon = 0x00 | (unsigned char)(eFreq << IRCF0) | (1 << SCS); // Use software I'd like to see how you get 500MHz out of your PIC (SW_OSCCON_CLOCK_500MHZ) Cheers Reynard -
Ternary Can't Do?
Reynard replied to Alistair George's topic in BoostC and Chameleon compilers programming
Hi Al, Something tells me this is not 'C'. You have a compound statement and not an expression. A ternary has the form: y = x>9 ? 100 : 200; Cheers Reynard -
How To Send Special Caracter To Lcd
Reynard replied to schneiderj's topic in BoostC and Chameleon compilers programming
Hi Jean-Marie, I hope you have a copy of the chip manual as it explains how to it very well. You have to write a raster pattern into CGRAM. CGRAM is 64 bytes which will let you store 8 characters (5x7). When you wish to display the CGRAM characters you give them the values of between 0 and 7 in your text string. You may want to avoid using character '0' as it may be seen as a NULL terminator in your program. The SourceBoost LCD library probably does not support writing to CGRAM so you will have to modify the library or better still write your own. Cheers Reynard -
How To Send Special Caracter To Lcd
Reynard replied to schneiderj's topic in BoostC and Chameleon compilers programming
Hi Jean-Marie, You cannot select the different fonts as they are 2 different chip parts. The A00 (HD44780UA00) is the Japanese standard font and the A02 (HD44780UA02) if the European standard font. You will have to purchase a display with the correct chip installed. Cheers Reynard -
I2c And Mclr Hard Reset Problem
Reynard replied to ryeg's topic in BoostC and Chameleon compilers programming
Hi Guys, Have you looked at the SSP errata sheet for the PIC16F819. It may have a connection with your problems. Cheers Reynard -
#pragma Clock_freq 8000000
Reynard replied to Alistair George's topic in BoostC and Chameleon compilers programming
The clock frequency in the #pragma informs the compiler of the instruction clock frequency (Fosc). In you case it would be 125000. The watchdog can be software controlled using wdtcon.SWDTEN. It is all explained on page 96 of the PIC manual. You can use the macro test_bit(). Cheers Reynard -
One Wire Serial Bus
Reynard replied to danmc77's topic in BoostC and Chameleon compilers programming
Hi Dan, It doesn't look like many people use this library. The library functions are for a master device so you will have to write your own slave emulation to do all the pulse width detection etc. It maybe more trouble than it's worth. Cheers Reynard -
Timer0 Interrupt Not Working
Reynard replied to Alistair George's topic in BoostC and Chameleon compilers programming
Hi Al, You have said in the config word that you are using an external crystal (_HS_OSC ) but you are selecting the internal oscillator in the osccon register. Your config should be for the internal oscillator (_INTOSCIO or _INTOSC). HTS is on the bottom of page 23. Cheers Reynard -
Timer0 Interrupt Not Working
Reynard replied to Alistair George's topic in BoostC and Chameleon compilers programming
Hi Al, Do you have the watchdog timer disabled or are you hitting it often enough. Timer 0 prescaler may be set to maximum value of 256 which could take some time for the timer to interrupt. If the watchdog is enabled, it may be resetting you all the time before the timer gets a chance to interrupt. Cheers Reynard ps: Tell us what PIC you are using to give us a chance to help you. -
Target Devices Supported By Boostc
Reynard replied to Dave's topic in BoostC and Chameleon compilers programming
Raghunathan, Have you checked out the latest V6.97 Beta release yet ? Cheers Reynard -
Hi Jean-Marie, Do you think it is because the values that you are using are not valid printable chars therefore MPLAB is replacing them on the display as a period. Can you change MPLAB to display variable content in hex to see what values you have in the array. Cheers Reynard
-
Hi Kevin, Did you purchase a BoostC or BoostC++ license ? I see from another of your postings that you are using Flowcode 4. Cheers Reynard
-
You could give us a few ideas to what the errors are that you are seeing. Have you included #include <system.h> to the top of your source files ? Do you have the correct PIC type selected ? Cheers Reynard
-
Newbie: Array As Argument Is Function
Reynard replied to malikms's topic in BoostC and Chameleon compilers programming
Hi Henry, In 'C' I would consider array and vector to be the same thing. In 'C++' you can have a vector class which can have a fixed size specified with the constructor and also be changable using a finctions of the vector class (set-size, add and delete). As the posting was in the BoostC section of the forum I assumed the poster to be using 'C'. Cheers Reynard -
Newbie: Array As Argument Is Function
Reynard replied to malikms's topic in BoostC and Chameleon compilers programming
Passing arrays (vectors) do have their exceptions. As you cannot pass an array by value a reference (pointer) to the first element is therefore passed. You don't have to tell the compiler it is a reference as you have no other choice. An argument of type T[] will be converted to a T* when passed as an argument. It's all in the manual somewhere folks. Cheers Reynard -
Newbie: Array As Argument Is Function
Reynard replied to malikms's topic in BoostC and Chameleon compilers programming
Hi Mark, Remember you are not passing the array but a pointer to it. So if your function modifies the array it is the original array that is being modified. Your function could have also have been declared using a pointer argument. signed long adc_decip (unsigned char *n) { signed long m; m = 0; m += *n++; m += *n++ * 10; m += *n++ * 100; m += *n++ * 1000; m += *n++ * 10000; if(adc_sign_digit==0) { m = m*(-1); } return m; } BoostC does not let you specify the size of the array though in the function argument e.g. signed long adc_deci (unsigned char n[5]). Cheers -
Precise Timings With Timer 0
Reynard replied to Shree's topic in BoostC and Chameleon compilers programming
Hi Shree, As you are using a 16F877A device, why not try using timer 2 and the preload register. That way you should be an interrupt every 250us and just let the timer free run and do its own thing. If you use the x4 post scaler the interrupts can arrive at 1ms intervals. Worth a try dude. Cheers Reynard -
Hi Tom, I think the case statement requires a constant expression rather than a constant variable with const attached to a type specifier. #define does work so you may have a typo. You may want to look at enum for you case constants. Cheers Reynard
-
Precise Timings With Timer 0
Reynard replied to Shree's topic in BoostC and Chameleon compilers programming
Shree, Are you taking into account that seconds go from 0 to 59 and 60 seconds doesn't exist ? Cheers Reynard -
Precise Timings With Timer 0
Reynard replied to Shree's topic in BoostC and Chameleon compilers programming
OK! Who's upsetting Reynard ? Shree, Remember that a program should be self documenting to limit the amout of comments that youu have to add to make it readable. Example: enum SW_STATE {OFF = 0, ON}; // switch states. volatile bit PushButtonSwitch@PORTE.1; // assign switch to port pin. volatile unsigned char LED_Port_1@PORTC; // assign units LED display to port. volatile unsigned char LED_Port_10@PORTD; // assign tens LED display to port. volatile unsigned char LED_Port_100@PORTB; // assign hundreds LED display to port. // Segment to port bit assignment. #define Sa 0x01 #defi