Search found 1469 matches

by Jerry Messina
Sun Mar 20, 2011 3:25 pm
Forum: Compiler
Topic: Can SSPI and SPI be run in parallel?
Replies: 9
Views: 4861

One thing I've noticed is that the file MCP23S17_MULT.bas calls a routine named 'EnableSPI()', but that sub isn't in my copy of SPI.bas. If you open SPI.bas, you'll see that routine referenced in the comments at the top. To add it, open SPI.bas and add the following to the end Public Sub EnableSPI()...
by Jerry Messina
Fri Mar 18, 2011 7:26 pm
Forum: User Modules
Topic: Interrupts
Replies: 21
Views: 10519

When you type in a terminal emulator, each character you type is a byte. Typing the two characters "FE" sends two bytes... ASCII "F" ($46) and ASCII "E" ($45). Before you changed things, when you had Send: FE1F0002FE1F0004FE1F0008 Get: FE1F0002FE1FByte Count Value Is 12 0004FE1F0008Byte Count Value ...
by Jerry Messina
Fri Mar 18, 2011 2:04 pm
Forum: User Modules
Topic: Interrupts
Replies: 21
Views: 10519

It looks like you renamed the modified USART.BAS file to USARTM.BAS. There's a potential problem with that... ISRRX needs to be able to see it as well (it includes USART.BAS too), and it won't find the right one if it's renamed. Change the name back to USART.BAS. Either put it in your project folder...
by Jerry Messina
Fri Mar 18, 2011 12:59 pm
Forum: User Modules
Topic: Interrupts
Replies: 21
Views: 10519

Could you post the whole file? I need to see the rest of it.
by Jerry Messina
Thu Mar 17, 2011 5:19 pm
Forum: User Modules
Topic: Interrupts
Replies: 21
Views: 10519

It does to a certain extent, but not completely. The decision to use 16-bit mode and the high speed baud rate is left to the user, and for some really slow rates at faster clocks, it's not really an option. In my experience, your almost always better off using the 16-bit BRG with BRGH=1 (so set both...
by Jerry Messina
Thu Mar 17, 2011 2:46 pm
Forum: User Modules
Topic: Interrupts
Replies: 21
Views: 10519

First off, when I showed the example of how to set the interrupt priorities, I should have been more clear that it was an example only. Remove this from your code Interrupt OnTimer1(ipLow) // code statements here End Interrupt Interrupt OnTimer3(ipHigh) // code statements here End Interrupt Now, as ...
by Jerry Messina
Wed Mar 16, 2011 5:50 pm
Forum: User Modules
Topic: Interrupts
Replies: 21
Views: 10519

You're mixing up events and ISR's. A good read of the manual sections on those topics might help ( http://www.sfcompiler.co.uk/downloads/SFManual.pdf ). Events are typically used as a way to extend the function of an isr without having to modify the original module code. They're a form of indirect s...
by Jerry Messina
Wed Mar 16, 2011 1:39 pm
Forum: Compiler
Topic: 18F67J60 and an LCD problem
Replies: 2
Views: 2375

typo? ADCON1 = $0F ' Turn off internal A/D channels ADCON1 = $00 ' Turn off internal A/D channels CMCON = $00 ' Disable comparetor outputs try ADCON1 = $0F ' Turn off internal A/D channels CMCON = $07 ' turn off comparators
by Jerry Messina
Tue Mar 15, 2011 6:35 pm
Forum: User Modules
Topic: Interrupts
Replies: 21
Views: 10519

I thought you were pretty close before, but since you've changed horses... The 18F supports two interrupt priority levels, high and low. By default, if you're only using one you don't have to do anything. If you have two priority levels, you have to assign the priorities in the ISR declaration somet...
by Jerry Messina
Mon Mar 14, 2011 5:47 pm
Forum: User Modules
Topic: UART TOOL
Replies: 23
Views: 11085

In addition to what Jon's pointed out... You have to have any '#option' statements BEFORE the module is included, so change it to #option TIMER_PRIORITY = ipLow #option TIMER_AUTO_RELOAD = true Include "ISRTimer.bas" Include "utils.bas" The parameter for Timer.Initialize() is the total number of tim...
by Jerry Messina
Mon Mar 14, 2011 2:35 pm
Forum: User Modules
Topic: UART TOOL
Replies: 23
Views: 11085

You can also setup a timer to free run and just use a polling method. This works best if you set the timer to work in 16-bit mode. TMR0 gives the longest duration since it has a 1:256 prescaler, but it also works with timers 1 and 3 (but they only have a 1:8 prescaler). Using this method you can hav...
by Jerry Messina
Mon Mar 14, 2011 10:39 am
Forum: User Modules
Topic: UART TOOL
Replies: 23
Views: 11085

I figured out that besides my coding errors the data coming in was inverted probably since I am using RS-485 hardware to interface to If the data's inverted, it's probably because the RS485 data signals are swapped around. It's a common, easily-made mistake. With RS485, the standard says that 'A' i...
by Jerry Messina
Sat Mar 12, 2011 7:53 pm
Forum: User Modules
Topic: UART TOOL
Replies: 23
Views: 11085

Is is possible to also run a timer 0 interrupt in the background and still use the ISSRX to receive characters ? I would like to toggle my LED off the timer then RX packets in between the TOGGLE when they come in, but let the RX have a higher priority Sure. By default, the ISRRX module is setup to ...
by Jerry Messina
Sat Mar 12, 2011 3:02 pm
Forum: User Modules
Topic: UART TOOL
Replies: 23
Views: 11085

If you have the UART tool connected up to the same ICSP connector that you use to program the chip, that won't work. You have to connect the UART tool RX and TX lines up to the PIC uart pins (see the pickit2 users guide). The ISRRX routine will automatically read bytes that come in on the uart and p...
by Jerry Messina
Fri Mar 11, 2011 7:58 pm
Forum: User Modules
Topic: UART TOOL
Replies: 23
Views: 11085

Widget- Perhaps I misunderstood how you were using the uart tool. I thought you were connecting the PIC TX -> uart Tool RX and using the USART.write(RXData(I)) to display the packet on the uart tool. If you're just connecting the uart tool RX to the PIC RX so you can see what the PIC ought to be see...