Hi,
I noticed this in an old program:
----------------------------------
RCON.IPEN = 1 'Must be included when using INTERRUPTS
-----------------------------------
C
I'm having problems downloading your GD files. Can you zoom in and tell me if the clock pulse comes slightly before the data line goes low? And, if it does, if Q0 goes high?
The UART stuff only gets executed if RCIF is one and that gets cleared when RCREG get read. So RCIF does get read.
Yes, I mentioned this in #383,
I'm having problems downloading your GD files. Can you zoom in and tell me if the clock pulse comes slightly before the data line goes low? And, if it does, if Q0 goes high?
Eventually, GPS will be added to this SERVO CODE.
If priority is important, then SERVOs should high, and GPS should be low, but if both can be high that would be better
C
There is no need for priority on interrupts unless the UART priority is set low so it can stay in there as long as it wishes and the time critical stuff can interrupt it. However, it's much better if the UART ISR is very short (as my earlier code) and then, once a valid sentence is received the main code can take care of it.
BTW, I already have the logic analyser code installed.
There is no need for priority on interrupts unless the UART priority is set low so it can stay in there as long as it wishes and the time critical stuff can interrupt it. However, it's much better if the UART ISR is very short (as my earlier code) and then, once a valid sentence is received the main code can take care of it.
BTW, I already have the logic analyser code installed.
Hi M,
I also tried to download it with a different email address, and couldn't, I'll see if I can get it to work.
Until I get the link working, I can screen shot parts of the analyser screen. Tell me what you need.
Ok, but leave the UART stuff till we've got the SERVO 'shift register' to work.
Hi,
I recall seeing this before.
----------------------------
char = RCREG
char = RCREG
------------------------------------
I understand that it's from a different program, but I think it's the same principle?
C
The double char = RCREG reading is only when you detect an error like overflow. It is used to flush the register, and not save anything.
Otherwise, one always reads RCREG if the RCIF bit is set…
The double char = RCREG reading is only when you detect an error like overflow. It is used to flush the register, and not save anything.
Otherwise, one always reads RCREG if the RCIF bit is set…
Hi S,
Ok, thanks.
As this is Usart related, it's better we leave it till later.
I'm good at remembering stuff that's not relevant, and forgetting stuff that is.
C
I've now got the logic analyser to work but don't understand it,
What does this mean,
The scale at the top suggests that the 0.235mS is correct but what is the 20mS and the 49.99Hz????
And how can channel 0 be the 8MHz clock, it looks more like 1.5kHz.
The scale at the top suggests that the 0.235mS is correct but what is the 20mS and the 49.99Hz????
And how can channel 0 be the 8MHz clock, it looks more like 1.5kHz.
As you have the hardware, are you able to load a hex file as I could send you the C hex file just to make sure that code actually works? Alternatively, are you able to use MPLABX (spit, spit) with an appropriate programmer (pickit4 etc.)?
As you have the hardware, are you able to load a hex file as I could send you the C hex file just to make sure that code actually works? Alternatively, are you able to use MPLABX (spit, spit) with an appropriate programmer (pickit4 etc.)?
Hi M,
1st,
Did you receive the email 'subject' faster data?
If so, did it open and show on your analyser?
Could you zoom in and out, and see the timings.
Anything with C is a nogo.
I don't have MPLABX as it's too bloated for my liking. EDIT: Send the HEX file, I can try it.
C
I got the email and new file but it still doesn't make any sense. It is full of "framing errors" - what are these? Is it trying to interpret it as 8 bit data?
As I said, doesn't have to be C but can your system upload a hex file?
I got the email and new file but it still doesn't make any sense. It is full of "framing errors" - what are these? Is it trying to interpret it as 8 bit data?
As I said, doesn't have to be C but can your system upload a hex file?
Hi,
I had a go at writing some simple SW to help me understand, how the 'shift register' works in practice. It simply switches the CLK and DATA ON/OFF in a series of CODE rows.
As only 3x SERVO inputs have been wired to the analyser, I only see 3.
I wired a SERVO to CH1 and it is working fine, considering it's SW, but there's nothing else INTERFERRING with it, so understandable, and only a test.
The CLK tic is only for a few uS, as has been explained, but seeing is believing
Here is the analyser view. EDIT: I was glad to see the HW PINs are working.
C
Hi M,
You'll laugh!
It's not CODE but a quick 'see if it's working'.
If the 1st list is run in a LOOP the SERVO has no jitter.
If you run both, you will see that CH1 is slightly different, this is the beginning of movement, but it looks like 'jitter', as it is backwards and forwards.
C.
-------------------------------------------------------------
Symbol rled = PORTD.7
RC0 = 0
RC2 = 0
Dim ch1 As Word
ch1 = 1000
Dim ch2 As Word
ch2 = 1000
Dim ch3 As Word
ch3 = 1000
Dim ch4 As Word
ch4 = 1000
Dim ch5 As Word
ch5 = 1000
Dim ch6 As Word
ch6 = 1000
Dim ch7 As Word
ch7 = 1000
Dim ch8 As Word
ch8 = 1000
They're working because you wrote the code using RC0 as the clock whereas the hardware needs RC2 to be the clock hence why the other code isn't working.