Search found 75 matches

by TonyR
Sat Oct 29, 2011 7:57 pm
Forum: User Modules
Topic: USART only returns first 2 bytes from incoming 8 bytes
Replies: 7
Views: 4763

Hi David, Thanks for reply. Actually the ATDL command block and read.byte block that works is all in a while wend loop. Like that I get the two chars returned at a one second interval reliably. I did try the extra while and wend. When I do that it hangs. I don't get the two chars returned at all. He...
by TonyR
Sat Oct 29, 2011 5:37 am
Forum: User Modules
Topic: USART only returns first 2 bytes from incoming 8 bytes
Replies: 7
Views: 4763

USART only returns first 2 bytes from incoming 8 bytes

Hi Everyone, this has got me stuck. I send an "ATDL" string to an Xbee from the TX1 of my 18F87J50 USART and that causes the Xbee to return 8 bytes of data + <CR> to my RX1. I can see the 8 bytes enter RX1 on my scope but my USART.readbyte loop runs out of chars after the getting only first two char...
by TonyR
Wed Oct 05, 2011 11:13 pm
Forum: General
Topic: RF Transceiver – Recommendations?
Replies: 15
Views: 10965

In case anyone searches out this link with Xbee Swordfish problems, the Series 2 Xbees don't work straight out of the box as promoted. I tried. You need to download X-CTU and do some simple configs. and set device addressing. There are some blogs around with how to do that. They work great once that...
by TonyR
Sun Oct 02, 2011 8:51 pm
Forum: Compiler
Topic: Time Delay
Replies: 3
Views: 2681

I just used a Ramtron FM3130 to do this because it has a Real Time Clock and 8K of static RAM built in as well. It works perfectly with the 18F87J50 and SF I2C library and lets the PIC sleep as much as it wants until alarms
by TonyR
Thu Sep 22, 2011 4:35 am
Forum: Modules
Topic: ADC readings are unstable!
Replies: 2
Views: 3082

Don't forget hardware-wise the analog module in your particular PIC may have separate analog ground and power pins, don't get digital noise on these, also unless you are using an external Vref for the ADC noise on your Vdd may appear on the ADC channels
by TonyR
Wed Jul 13, 2011 6:12 am
Forum: User Modules
Topic: MRF24J40
Replies: 12
Views: 12224

MRF24J40 Zigbee Transmit Receive

Good Afternoon All

Well I am about to design a small network which will use MRF24J40, and I hope to use SF and 18F87J50 sinceI know them now.

Has anyone had luck getting an MRF24J40 going with SF that could help?

I hope someone has, the datasheets look huge!
by TonyR
Tue Apr 05, 2011 8:29 pm
Forum: User Modules
Topic: Public Variable not visible in Module Routine
Replies: 4
Views: 3540

Thanks Gentlemen, I got it working by moving the public dim statement into the Timer3 ISR module, I was expecting SF to act like VB. Will be aware from now on.
by TonyR
Mon Apr 04, 2011 11:43 pm
Forum: User Modules
Topic: Public Variable not visible in Module Routine
Replies: 4
Views: 3540

Public Variable not visible in Module Routine

I have an 18F87J50 program with three modules which compiles OK. I need a public variable called Hightime. When I add the line "Public Dim Hightime As Word" in main, the program still compiles OK. As below. When I try to use Hightime in module "TIMER3 ISR.bas" I get "Identifier not declared: Hightim...
by TonyR
Wed Mar 30, 2011 5:33 am
Forum: User Modules
Topic: Im using SetBaudrate(br2400) but getting 9600?
Replies: 5
Views: 3627

Its fixed, thank you for the valuable clues Jerry!

I changed setBaudrate to

Public Sub SetBaudrate(pSPBRG As Word = br19200)
SPBRG1 = pSPBRG.byte0
SPBRGH1 = pSPBRG.byte1


For 18F87J50 at least
by TonyR
Wed Mar 30, 2011 5:12 am
Forum: User Modules
Topic: Im using SetBaudrate(br2400) but getting 9600?
Replies: 5
Views: 3627

Hi Jerry, I pasted in #option USART_BRGH = true #option USART_BRG16 = true Include "usart-2.bas" and changed setBaudrate to Public Sub SetBaudrate(pSPBRG As Word = br19200) SPBRG = pSPBRG.byte0 SPBRGH = pSPBRG.byte1 but at compile time SPBRGH is "Identifier not declared" Looking in 18F87J50 file I f...
by TonyR
Tue Mar 29, 2011 1:21 am
Forum: User Modules
Topic: Im using SetBaudrate(br2400) but getting 9600?
Replies: 5
Views: 3627

Thanks for that advice Jerry. Because I'm in a hurry with this project I pasted in the #option statements and hoped that would fix the problem without requiring any thinking on my part! But it didn't fix. Do I need to set the CONFIG register and OSCON register as well as setup BRG? This will require...
by TonyR
Tue Mar 29, 2011 1:17 am
Forum: User Modules
Topic: How to generate 10KHz to 200KHz with 18F87J50 ?
Replies: 3
Views: 2834

1KHz Steps

As I think you are guessing they weren't exactly 1KHz steps, just 12MHz divided by the values in 16bit counter.

With external 48MHz clock instead of original 12MHz crystal the steps at the 200KHz end were tolerable for my app.
by TonyR
Mon Mar 28, 2011 5:08 pm
Forum: User Modules
Topic: Im using SetBaudrate(br2400) but getting 9600?
Replies: 5
Views: 3627

Im using SetBaudrate(br2400) but getting 9600?

Im using SetBaudrate(br2400) but getting 9600? PIC18F87J50 with 48MHz external clock. Do I need to set something else? Thanks. Device = 18F87J50 Clock = 48 Include "usart.bas" Dim LED As PORTE.1 SetBaudrate(br2400) While true High(LED) DelayMS(100) ' ' Send parameters to PC ' Write("*") ' synch word...
by TonyR
Mon Mar 28, 2011 4:57 pm
Forum: User Modules
Topic: How to generate 10KHz to 200KHz with 18F87J50 ?
Replies: 3
Views: 2834

Solved

Solved by clocking PIC at 48MHz and using timer3 and interrupt
by TonyR
Tue Mar 15, 2011 5:53 am
Forum: User Modules
Topic: How to generate 10KHz to 200KHz with 18F87J50 ?
Replies: 3
Views: 2834

How to generate 10KHz to 200KHz with 18F87J50 ?

Hi All,

Can anyone suggest an "easy" way to generate 10KHz to 200KHz in 1KHz steps from 12MHz clocked 18F87J50?

I tried the code sample "Using PWM with Swordfish" and found I could nicely get anything up to 65KHz.

Do I have to resort to look up tables?

Thanks for any suggestions.