Search found 126 matches
- Wed Jul 29, 2020 1:02 am
- Forum: Modules
- Topic: Can't get spi to read data
- Replies: 19
- Views: 11354
Re: Can't get spi to read data
Jerry: Thanks for the reply and code. I have not had a chance to do anything with it yet. Am one of the recently unemployed and picking up odd handyman jobs. Here is what I had so far. I put a 'stop' after the first register write/read just to test in the INIT routine. The register values were recom...
- Fri Jul 24, 2020 11:45 pm
- Forum: Modules
- Topic: Can't get spi to read data
- Replies: 19
- Views: 11354
Re: Can't get spi to read data
The radio PN is MRF89XAM9A from Microchip. It was marketed as a simple radio module but has really not been. On the same circuit I have an SPI FRAM device and I can write and read from it with not problem. The only difference is the FRAM uses SPI1 and the radio SPI2. The project is two different cir...
- Wed Jul 22, 2020 9:51 pm
- Forum: Modules
- Topic: Can't get spi to read data
- Replies: 19
- Views: 11354
Re: Can't get spi to read data
Jerry: Sorry did not get back before now. Life happens... I am still having a problem with the 18F47J13 SPI with a Microchip radio. Here is a comment from their help: "An important point for the 18F47J13. Specifically, for every byte SPI is transferred, the SPI (MSSP) buffered value need to be read....
- Tue May 05, 2020 1:37 pm
- Forum: Modules
- Topic: Can't get spi to read data
- Replies: 19
- Views: 11354
Re: Can't get spi to read data
Jerry: That definitely did make a difference! I now get: GCON = 01000111 47 GCON = 01000111 47 GCON = 01000111 47 GCON = 01000111 47 SSPBUF = 01000111 47 I should be writing then reading a hex 68, 28, then 88. I will put the scope on it tonight and see what is happening. Also, I did not look far int...
- Mon May 04, 2020 7:27 pm
- Forum: Modules
- Topic: Can't get spi to read data
- Replies: 19
- Views: 11354
Re: Can't get spi to read data
Jerry: Thanks for the reply and hope all is well in these crazy times. I have changed the SPI1.ReadByte to SPI1.Transfer(). I have also put a statement to show that TRISB.4, the SDI pin, is an input. This should satisfy the SetAllDigital() call requirement. In the parent routine only AN2 is enabled ...
- Sun Apr 26, 2020 5:23 pm
- Forum: Modules
- Topic: Can't get spi to read data
- Replies: 19
- Views: 11354
Can't get spi to read data
I am having a problem getting SPI data from a radio. A paired circuit with the same circuit uses the same radio and works so I know the logic is good. the other circuit has an 18F47J13 and uses SPI2 and Jerry M's PPS module (great code!). This circuit uses an 18F14K22. I use the exact same settings ...
- Tue Oct 08, 2019 2:36 am
- Forum: User Modules
- Topic: Problem with either SPI2, or PPS
- Replies: 3
- Views: 3948
Re: Problem with either SPI2, or PPS
Thanks, that worked.
One more question. What is the correct syntax for SPI send and receive using 'Transfer'?
works but the module implies it is used for both send and recieve.
Thanks!
One more question. What is the correct syntax for SPI send and receive using 'Transfer'?
Code: Select all
SPI2.Transfer(gcon_addr_r)
b1 = SPI2.ReadByte
Thanks!
- Sun Sep 29, 2019 10:39 am
- Forum: User Modules
- Topic: Problem with either SPI2, or PPS
- Replies: 3
- Views: 3948
Problem with either SPI2, or PPS
I am trying to talk to a Microchip MRF89XA radio with PPS SPI pins. Here is my main routine and the radio routine Device = 18F47J13 Clock = 8 // LCD... #option LCD_DATA = PORTD.4 #option LCD_RS = PORTA.7 #option LCD_EN = PORTA.6 #option LCD_INIT_DELAY = 100 #option LCD_DATA_US = 50 #option LCD_COMMA...
- Mon Dec 30, 2013 10:12 pm
- Forum: Compiler
- Topic: Can not ger 1200 baud to work
- Replies: 4
- Views: 2823
Re: Can not ger 1200 baud to work
Jerry: Again, thanks so much for the help. I see on this forum that you seem to help out everyone and wish there was some way to thank you other than just saying thanks. I did get it working. Turns out there is a type on the help file. It states: #option USART_BRGH16 Links in code to support 16 bit ...
- Sat Dec 28, 2013 12:25 am
- Forum: Compiler
- Topic: Can not ger 1200 baud to work
- Replies: 4
- Views: 2823
Re: Can not ger 1200 baud to work
Jerry: Thanks for the reply. This is the change. **************************************************************************** * Name : SetBaudrate * * Purpose : Sets the hardware USART baudrate * * : Pass SPBRG constant, as defined above. For example, br115200 * *************************************...
- Fri Dec 27, 2013 7:52 pm
- Forum: Compiler
- Topic: Can not ger 1200 baud to work
- Replies: 4
- Views: 2823
Can not ger 1200 baud to work
I need to send and receive at 1200 baud on an 18F47J13. The data sheet (page 352) shows the best option at fosc=8.000mhz is for BRGH = 1, BRG_16 = 1, SYNC = 0, SPBRG = 1665d or SPBRGH = $06 and SPBRG = $81. However, when I look at the signal on the scope it is not even close to 1200 baud. I have put...
- Thu Mar 29, 2012 11:29 am
- Forum: Modules
- Topic: variable 'FIndexOut' might have not been initialized
- Replies: 8
- Views: 4388
Jerry: Right again. Mixing ISRRX and USART seemed to cause problems when using an LCD. No idea why but when I commented out the LCD code it worked again. An your 'untested' code ran just as commented! I cut, paste, compile, ran. I sure wish I could properly thank you for this and previous help. It i...
- Thu Mar 15, 2012 12:00 pm
- Forum: Modules
- Topic: LCD and 18F8722
- Replies: 6
- Views: 3961
Solved. Got out the circuit with the 18f6680 and loaded the same code and the LCD worked fine on port A. Broke out the scope to see if could find anything and saw that the 5vdc was about 5.3vdc. I was using a generic wall wort with a 7805 and 2 caps. Swapped in the 5vdc switcher and worked fine. Als...
- Tue Mar 13, 2012 9:04 pm
- Forum: Modules
- Topic: LCD and 18F8722
- Replies: 6
- Views: 3961
So, which pin are you using for data out to the LCD? #option LCD_DATA = PORTA.0 Data pins are porta.0 - porta.3. It looks like you're using the USARTs to do so... I have the same message go out to hypertem so I know the device and code are running. Also flash the LED. What I do not understand is if...
- Sat Mar 10, 2012 5:54 pm
- Forum: Modules
- Topic: LCD and 18F8722
- Replies: 6
- Views: 3961
LCD and 18F8722
I am having trouble with an LCD on an 18F8722 on PORTA. If I comment out the line #option LCD_DATA = PORTA.0, the rest of the program executes, get serial message on hterm and LED's flash. If the line is not commented out nothing happens. I am pretty sure the A/D is disabled. Hopefully I don't make ...