Search found 219 matches

by SHughes_Fusion
Thu Mar 09, 2017 8:36 am
Forum: Compiler
Topic: How much RAM? Or where does RAM end?
Replies: 4
Views: 3556

Re: How much RAM? Or where does RAM end?

Thanks, Jerry, that is very helpful.

Must admit I'm slightly confused - I'm sure I've read of this device having 3936 bytes of RAM but the datasheet now shows 3896 correctly. I wonder if MChip got it wrong in the first place...
by SHughes_Fusion
Wed Mar 08, 2017 4:18 pm
Forum: Compiler
Topic: How much RAM? Or where does RAM end?
Replies: 4
Views: 3556

How much RAM? Or where does RAM end?

I've spent the day trying to find a bug which it turns out is down to a ClearRAM routine I wrote a while back incorrectly clearing some SFRs. The routine is below, but I use the _maxram value from the device header. In most cases this would be OK, but on some devices you don't actually seem to have ...
by SHughes_Fusion
Thu Oct 20, 2016 10:05 am
Forum: Compiler
Topic: Overloading and subs with default parameters
Replies: 6
Views: 5307

Re: Overloading and subs with default parameters

Thanks, Jerry, that works. I think I actually ended up getting confused by the example in the help file as that is pretty much what I was planning to do but got the impression it wasn't possible from that example so tried initialising to zero instead. You are right that in this case I don't need to ...
by SHughes_Fusion
Thu Oct 20, 2016 6:55 am
Forum: Compiler
Topic: Overloading and subs with default parameters
Replies: 6
Views: 5307

Re: Overloading and subs with default parameters

Thanks both, so in other words I can't do what I am trying to do and even for events which don't need data I still need to pass a value so SF can decide which to use? I guess the ideal solution here would be if you could specify a 'default' one to call in these cases - for what I'm doing, it doesn't...
by SHughes_Fusion
Wed Oct 19, 2016 4:03 pm
Forum: Compiler
Topic: Overloading and subs with default parameters
Replies: 6
Views: 5307

Overloading and subs with default parameters

Does the compiler support overloading and pre-loading of sub parameters at the same time? I've tried declaring a series of subs which load different data types in to a log, with the data value pre-set to zero. However, the compiler complains that it can't determine which one to use. It worked fine b...
by SHughes_Fusion
Fri Apr 08, 2016 9:28 am
Forum: User Modules
Topic: Anyone used a HIH6030 humidity sensor?
Replies: 7
Views: 6719

Re: Anyone used a HIH6030 humidity sensor?

A couple of quick suggestions. Firstly, you don't seem to be checking the status bits, just assuming the results are OK. May be worth adding a check. Second, is your clock set up correctly? You are assuming the DelayMS(100) is long enough for the conversion to complete. The datasheet does say 50mS s...
by SHughes_Fusion
Mon Mar 21, 2016 8:23 am
Forum: IDE
Topic: IDE selecting wrong includes
Replies: 3
Views: 4936

Re: IDE selecting wrong includes

Thanks, Jerry, that at least seems to have done the job.

Still wish we had more control over where SF searches....
by SHughes_Fusion
Thu Mar 17, 2016 2:08 pm
Forum: IDE
Topic: IDE selecting wrong includes
Replies: 3
Views: 4936

Re: IDE selecting wrong includes

Apologies, I've been caught out again by the way Swordfish looks for libraries. I've just realised it is totally ignoring the new UserLibrary folder I created on my desktop and if it can't find the library in My Documents then takes what it can find elsewhere... What a mess... Is there a way to redi...
by SHughes_Fusion
Thu Mar 17, 2016 12:01 pm
Forum: IDE
Topic: IDE selecting wrong includes
Replies: 3
Views: 4936

IDE selecting wrong includes

There appears to be a bug in the IDE relating to includes. I've been trying to fix a bug in some code and was mystified why a change I was making wasn't making any difference. I'd opened an include by clicking on the entry in the Code Explorer. I made some changes to that file, went back to the main...
by SHughes_Fusion
Fri Feb 19, 2016 10:34 am
Forum: IDE
Topic: Way to verify consts?
Replies: 6
Views: 5962

Re: Way to verify consts?

> are there any compiler constants for the size of the various variables I don't understand the question I'm thinking rather than #if rval > $FF you could use #if rval > Sizeof(Byte) - it is clearer what you are checking against. Not essential of course, just seems a bit more readable to me. > Pers...
by SHughes_Fusion
Fri Feb 19, 2016 10:19 am
Forum: User Modules
Topic: ISR for ADC's
Replies: 14
Views: 10404

Re: ISR for ADC's

Daft question, but have you considered using an LED driver chip to generate your PWM control signal? NXP for example do some I2C controlled ones with fairly high PWM resolutions and I've also seen some which offer things like staggered outputs and PWM dithering. It might add a couple of quid to your...
by SHughes_Fusion
Fri Feb 19, 2016 10:04 am
Forum: IDE
Topic: Way to verify consts?
Replies: 6
Views: 5962

Re: Way to verify consts?

Thanks, David, I'd not thought of doing it that way. One question though, are there any compiler constants for the size of the various variables? Not a problem to define them I guess rather than putting in a specific size for each test. Personally, I'd say this is the sort of check that would be bet...
by SHughes_Fusion
Fri Feb 19, 2016 9:02 am
Forum: IDE
Topic: Way to verify consts?
Replies: 6
Views: 5962

Way to verify consts?

I'm sure I'm not alone in using equations in my code to calculate timer-related consts and I'm sure I'm also not alone in having occasionally been caught out by the calculated const exceeding the size of the variable type. I don't know if David is still developing the IDE, but a suggestion would be ...
by SHughes_Fusion
Thu Jan 14, 2016 2:15 pm
Forum: User Modules
Topic: Bootloader - 200 x l PIC18F on same RS485 bus
Replies: 5
Views: 5721

Re: Bootloader - 200 x l PIC18F on same RS485 bus

Interesting idea... My preferred terminal (Coolterm) doesn't seem to support it but I guess it is easy enough to look at another. Presumably it complicated matters slightly as you might not get a full block of data in one go from the .hex file as it is split in to fixed size chunks rather than send ...
by SHughes_Fusion
Thu Jan 14, 2016 9:34 am
Forum: User Modules
Topic: Buffered UART routines
Replies: 2
Views: 4226

Re: Buffered UART routines

Good idea to use a timer to control direction change. I wish Microchip had included an interrupt for transmit shift register empty as it would make life much easier here! I originally polled TRMT in my main loop but I was finding that on occasion it wasn't being picked up fast enough and the transmi...