Search found 219 matches

by SHughes_Fusion
Thu Jan 14, 2016 9:22 am
Forum: User Modules
Topic: Bootloader - 200 x l PIC18F on same RS485 bus
Replies: 5
Views: 5393

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

I've written my own bootloader for RS485, I've never used the Swordfish one so I can only give a few hints and thoughts. The first one being, I'm assuming you have modified the bootloader to control the bus direction. Secondly, and this one is causing me a slight headache still, don't forget there i...
by SHughes_Fusion
Wed Jan 13, 2016 10:59 am
Forum: User Modules
Topic: Buffered UART routines
Replies: 2
Views: 3907

Buffered UART routines

Does anyone have any insight in to how to do a buffered serial transmit routine? I thought I'd done one but I've just realised that it doesn't in fact work! The crux is the ISR code - I was wondering why my RS485 bus was going back to 0V after each byte. This is my ISR transmit code: // Transmit int...
by SHughes_Fusion
Wed Nov 04, 2015 9:16 am
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

Problem solved! It was include order - and me being lazy / a bit of a numpty. I've got two versions of hardware for this project so I've added a 'Versions.bas' file which sets various things up based on which version is specified in a #define at the top of the main. When I was changing the order I w...
by SHughes_Fusion
Tue Nov 03, 2015 2:56 pm
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

I did try using a local boolean but it didn't seem to help - added about 4 extra instructions. That said, I didn't use it in all the places I could so it may help overall. To be honest, I'm not so bothered about saving code here, more trying to work out why one of the LED flickers when there is UART...
by SHughes_Fusion
Tue Nov 03, 2015 12:23 pm
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

Good point, Jerry, I'll check but generally I do make a point of calling module.function just to be sure. I can say for sure it isn't the actual LED multiplexing as that compiles the same for both versions - with the exception of some line labels differing. The serial comms looks a lot different so ...
by SHughes_Fusion
Tue Nov 03, 2015 11:47 am
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

Back OT - I think I have found an issue with Bank Switching. I'd tried re-ordering the includes in another program to minimise the MOVLB commands. This introduced an issue where one of the LEDs was flickering. Put the includes back to the original order and the code size goes up by 200-odd bytes but...
by SHughes_Fusion
Tue Nov 03, 2015 9:11 am
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

Thinking about it, Microchip's advantage in the 32 bit field is their peripherals. If they aren't going to develop their own core then they might be better off offering a few core options. I can see more ARM developers moving to Microchip if they offered an ARM core PIC32 than if they have to learn ...
by SHughes_Fusion
Mon Nov 02, 2015 3:21 pm
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

(Getting OT here, my apologies!) I wonder if there is some limitation with the PIC18 core, maybe size? I'm surprised there are no 14 pin or even 8 pin variants - after all, they do smaller pin version of the PIC24 than they do of the PIC18. I don't know if the 16F1 core fixes any issues which makes ...
by SHughes_Fusion
Mon Nov 02, 2015 3:05 pm
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

I do wonder if Microchip have either lost some good people or have simply grown too fast. The stuff about the bugs in the PIC32s is very worrying. I also wonder why nothing seems to be happening with the PIC18s - the last chip to be announced was the K40 series but it's over a year since they were l...
by SHughes_Fusion
Mon Nov 02, 2015 10:12 am
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

Thanks, both. I was veering towards the PIC24 anyway so what you've said has confirmed the choice in my mind. It seems a more 'integrated' option - I get the feeling Microchip decided they had to have a 32 bit core and didn't have the time / resources to design their own so just stuck the MIPS one i...
by SHughes_Fusion
Mon Nov 02, 2015 9:40 am
Forum: IDE
Topic: Programmer options
Replies: 1
Views: 4238

Programmer options

While I've never used it, I note that Swordfish has the option to program your code directly after compilation. Is there any way to add the PICKit3 to the list of programmers? It doesn't show as an option by default. Also, how do you go about adding new programmers? I've developed my own bootloader ...
by SHughes_Fusion
Fri Oct 30, 2015 2:00 pm
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

I don't give up that easily! :wink: With a bit more messing I've knocked another 40 MOVLBs off. I can't see it getting any smaller though. I've now started looking at other, bigger programs. One that compiled to 19503 bytes using 2495 bytes of RAM contains 1589 MOVLB instructions. That's over 16% of...
by SHughes_Fusion
Thu Oct 29, 2015 3:23 pm
Forum: Compiler
Topic: Compiler Const bug?
Replies: 15
Views: 7051

Re: Compiler Const bug?

Good points - I use EE.Write as it seemed meant to be the 'generic' way to do things and it would automatically choose to write it as a longword. You are correct though that if I specified the data size to write it would work OK. I usually avoid this if I can as it makes changing the type prone to e...
by SHughes_Fusion
Thu Oct 29, 2015 2:57 pm
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

You're right. I tried moving things around in the Globals.bas file. The first variables I moved made no difference. Then I moved two Integers from the end of the file to the middle. Program size went up by 87 instructions. Searching the file, there were 80 more MOVLB instructions... Now I'm wonderin...
by SHughes_Fusion
Thu Oct 29, 2015 12:38 pm
Forum: Compiler
Topic: Tips for optimising bank switching?
Replies: 27
Views: 10167

Re: Tips for optimising bank switching?

I'll have a play with your code and see what I can learn from it. I had saved the .asm from an older version of my code with a buffer size of 8. I can't recall the exact size this compiled to, around 9600 bytes I believe. This contains 323 MOVLB instructions. The .asm with all variable declarations ...