Search found 15 matches

by tcdev
Sat Jan 31, 2015 2:03 am
Forum: Modules
Topic: USART, ISRRX, Overrun and latest compiler
Replies: 6
Views: 6041

Re: USART, ISRRX, Overrun and latest compiler

Sounds like lots of fun! For some definitions of the word 'fun'! :wink: - make sure only one peripheral is using each priority... otherwise you need to add additional code to the isr's to check for both the IF and IE bits being set. My low priority ISR handles both ADC and Timer0 interrupts, but I'...
by tcdev
Fri Jan 30, 2015 10:13 pm
Forum: Modules
Topic: USART, ISRRX, Overrun and latest compiler
Replies: 6
Views: 6041

Re: USART, ISRRX, Overrun and latest compiler

The default ISRRX interrupt routine doesn't automatically clear a UART Overrun error. Noted, as I suspected. Given the horrible architecture of this code, it's a major issue, hence my work-around by disabling RX during potential overrun code paths. If you don't do this, then the code the ISRRX isr ...
by tcdev
Fri Jan 30, 2015 7:13 am
Forum: Modules
Topic: USART, ISRRX, Overrun and latest compiler
Replies: 6
Views: 6041

USART, ISRRX, Overrun and latest compiler

You'll have to bear with me as I'm still a little up-in-the-air about exactly what is going on, but sometimes posting to a forum brings a 'eureka' moment. At this stage though, I'm going to go out on a limb and declare that either the code I have inherited is doing something very wrong, or there's s...
by tcdev
Tue Jan 27, 2015 11:49 pm
Forum: Modules
Topic: 18F87J93 _eeprom=0?
Replies: 11
Views: 7651

Re: 18F87J93 _eeprom=0?

... and I must admit the requirement still seems peculiar to me but, it is evidently quite important! Here's the datasheet note: Before setting the WR bit, the Table Pointer address needs to be within the intended address range of the 64 bytes in the holding register. I think that comes from that f...
by tcdev
Tue Jan 27, 2015 12:00 pm
Forum: Modules
Topic: 18F87J93 _eeprom=0?
Replies: 11
Views: 7651

Re: 18F87J93 _eeprom=0?

And to provide closure on this one as well... I've implemented my EEPROM read/write routines and it appears to work well. All based on the Microchip-supplied PIC18F EEPROM emulation code written in C, albeit much more fundamental as I expect to be writing the EEPROM only a handful of times through i...
by tcdev
Tue Jan 27, 2015 11:51 am
Forum: Modules
Topic: GLCD and interrupts
Replies: 5
Views: 4138

Re: GLCD and interrupts

Many thanks to Jerry and Octal ; I've implemented your suggestions and it's all good! FTR it seems only FSR0 was being used - once I removed the call to ToggleLED() - so a simple save(FSR0) did the trick! Also noted the High()/Low() optimisations. You've certainly saved me some head scratching with ...
by tcdev
Tue Jan 27, 2015 2:27 am
Forum: Modules
Topic: GLCD and interrupts
Replies: 5
Views: 4138

Re: GLCD and interrupts

The isr LOOKS like it's long and involved, but if you take a closer look it's already arranged as a state machine and the code is actually pretty straight forward. I completely agree with octal on the point that in general you DO need to watch what it is you put in an isr. You can easily make a rea...
by tcdev
Tue Jan 27, 2015 2:11 am
Forum: Modules
Topic: 18F87J93 _eeprom=0?
Replies: 11
Views: 7651

Re: 18F87J93 _eeprom=0?

The easiest thing is probably to place your "EEPROM" space at the top of memory. That way you can change the SF '_maxrom' setting so that it will always reserve that page. However, the config words for the J90 are kept in the last few bytes of the last page @ 0x1FFF8 (erase block 0x1FC00). Since yo...
by tcdev
Fri Jan 23, 2015 12:21 pm
Forum: Modules
Topic: GLCD and interrupts
Replies: 5
Views: 4138

GLCD and interrupts

As mentioned in another post, I've inherited an existing design and have been charged with fixing it, despite having zero prior experience with either PIC18F or Swordfish BASIC. I am an experienced embedded software engineer, so I'd argue it's not a hopeless case. :mrgreen: Oh, and it has to be done...
by tcdev
Fri Jan 23, 2015 11:56 am
Forum: Modules
Topic: 18F87J93 _eeprom=0?
Replies: 11
Views: 7651

Re: 18F87J93 _eeprom=0?

it's pretty straight forward, just requires more work than EEPROM. If you are uncomfortable with the concept, there are plenty of 18F devices with authentic EEPROM - use one of them instead for your design - or use an external EEPROM chip. Not uncomfortable with the concept at all, just disappointe...
by tcdev
Fri Jan 23, 2015 5:26 am
Forum: Modules
Topic: 18F87J93 _eeprom=0?
Replies: 11
Views: 7651

Re: 18F87J93 _eeprom=0?

And to have a stab at answering my own question... Looking at the 18F87J90 Family Datasheet and the EEPROM.bas code, it looks like the device will support EEPROM, but the library is not compatible with this device. Amongst other differences, the 87J90 appears to require erasing of pages (64 bytes) b...
by tcdev
Fri Jan 23, 2015 5:00 am
Forum: Modules
Topic: 18F87J93 _eeprom=0?
Replies: 11
Views: 7651

18F87J93 _eeprom=0?

From the datasheet:

"Flash Program Memory has Word Write Capability for Data EEPROM Emulators"

I would have assumed this meant it had support for the Swordfish EEPROM library!?! Am I wrong? Is this a bug?
by tcdev
Tue Jan 20, 2015 7:39 am
Forum: User Modules
Topic: ISRRX.OnData stops firing
Replies: 5
Views: 5169

Re: ISRRX.OnData stops firing

@Coccoliso: you're a saviour! Changing to an event did indeed fix the issue! Thanks!

Now I'm absorbing the documentation on events and trying to understand how that would change referencing a Public alias in the calling ISR...
by tcdev
Tue Jan 20, 2015 7:30 am
Forum: User Modules
Topic: ISRRX.OnData stops firing
Replies: 5
Views: 5169

Re: ISRRX.OnData stops firing

OK, found an issue, but can't explain it. I noticed that the length of time that communications were working was related to ISRRX.RX_BUFFER_SIZE. Now I've confirmed that it is getting ISRRX.BufferOverrun when communications fails. Herein lies the problem; my OnData subroutine has ISRRX.ProcessByte =...
by tcdev
Tue Jan 20, 2015 5:55 am
Forum: User Modules
Topic: ISRRX.OnData stops firing
Replies: 5
Views: 5169

ISRRX.OnData stops firing

Hi gurus, I've only just recently inherited a project to debug and am having problems getting the code - as delivered - to function correctly. I've purchased the most recent Swordfish compiler as the client doesn't have access to it - the previous contractor owned the copy. I can only assume it's an...