Morning E,Morning C,
Which programs are you referring too.?
I thought we were going to focus on just getting the HW SPI test running on the 4620 and 4431.??
Then you post it, so that I can upgrade the data being transferred.
E
Hi E,OK,,
So please post your HW SPI Master and Slave test programs.
Hi E,hi,
Downloaded your programs, will check later.
The logic analyser waveforms are not really helpful.
I suggest you use the UART for monitoring and posting the data.
E
Hi E,hi,
Downloaded your programs, will check later.
The logic analyser waveforms are not really helpful.
I suggest you use the UART for monitoring and posting the data.
E
Hi E,hi,
The csv file shows SPI data OK.????
Are you using a xtal on the 4620, you have HS set in the CONFIG header, if yes, waht is the xtal frequency.
Otherwise the two progs are identical with the ones I posted, with exception of the pin assignment.
E
Hi E,hi,
If they are both running at 8Mhz, as I had during the test, thats OK.
Have you made any hardware changes since you successfully ran those two programs.?
Any reason why you are not using the 4620 internal 8MHz oscillator.?
E
BTW: as you are using the latest Oshonsoft IDE's, why are you using Crlf Dim's in the Slave .?
'Cartn = Chr(0x0d) ' redundant
'lfd = Chr(0x0a)
Dim s2m As Byte
Dim m2s As Byte
Dim dta As String
msg1 = "ABCD" + Cr + Lf 'initial dummy msg
/////////////
You are already doing that in the Master
Dim x As Byte
Dim y As Byte
msg1 = "1234" + Cr + Lf
msg2 = "ERIC" + Cr + Lf
Hseropen 9600
WaitMs 1000
Hi E,hi,
These Dims are not required
'Cartn = Chr(0x0d) ' redundant
'lfd = Chr(0x0a)
The Cr and Lf codes are now a part of the latest Oshonsoft compiler.
ie:
Cr ; Carriage Return
Lf ; Line Feed.
In your actual BMP program you do not require any Cr or Lf Codes, they are were only for testing using ASCII bytes,, ie: ERIC 1234 etc...
If you do include them, remember you are Writing/Reading Binary Data Bytes, which could include 0x0D and 0x0A as part of the Data group, so do not use these line terminator Codes.
I would also use the 4620 Int Osc at 8MHz.
E
Hi,hi C,
You are mixing the descriptions up, are you asking about Master <> Slave or Master to BMP
I have already covered this point, run them both at 8MHz using the internal clocks.
You had the test programs working this way, so why do you keep changing the set up.?
The code fragment in #455 is wrong, why is there a 5 milli-sec delay.?
altmtr = 0
SSPBUF = 0xf4
While Not SSPSTAT.BF ' this sends the Reg Addr 0xF4 to the BMP
Wend
dta = SSPBUF ' this is invalid data from the BMP, due to the 0xF4 Write, its not wanted in the 'dta'
'WaitMs 5 '2
SSPBUF = dummy
While Not SSPSTAT.BF
Wend
dta = SSPBUF ' you are now overwriting the invalid data in the 'dta' with the requested Reg data
WaitUs 5 '2
Hserout "F4 ", #dta, CrLf
altmtr = 1
hi,As this PCB is getting tired I re-checked for whiskers and failed solder. Some where there was a problem, as it's now working.
Hi E,hi,
This is one of the reasons why I prefer to debug designs on bread board [ when possible] , it saves lots of time and reworking.
I guess you know that you can get adaptor PCB's for most surface mount devices.
Ref the timing, try to keep the response time of the peripheral device as fast as possible, one way is to write linear code rather than Calls to subroutines.
E