Hi C did this include tying PGM pin 26 to GND ? G Not happy about 'floating pins'Bug2, I've tried all possible programming combinations I think.
Eric was this a simulation or actual hardware ?Also I have extensively run a test program for the 18F2431 UART RXD function, the OERR and FERR are NOT a problem
On High Interrupt
Save System
'interrupt on INDEX pulse PORTC.4 input.
pir3.ic2qeif = 0 'clr in s/w, poscnt=maxcnt or indx
PORTA.4 = 0
''Hserout "Ix=", #azimval, " ", #poscnt, CrLf
PORTA.4 = 1
pie3.ic2qeie = 1 'qei intr enb
Resume
If poscnt < azimval Then
If azimval - poscnt >= 1800 Then
PORTC.5 = 1 'rev passes thru 000 > 3599 index
Else
PORTC.5 = 0
Endif
Gosub pwm_cont
Goto get_count 'keep reading cap2buf [poscnt]
Endif
If PORTC.5 = 0 Then 'FWD PWM
revn = 0 '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
ASM: bcf CCP2CON,DC2B0
ASM: bcf CCP2CON,DC2B1
ASM: movlw 0x00
ASM: movwf CCPR2L
PWMduty 1, duty1
forn = 1 '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
Endif
Hi C did this include tying PGM pin 26 to GND ? G Not happy about 'floating pins'as they possibly are all inputs ? MC recommend making unused pins outputs and writing '0' to them. or unused pins TRIS d as inputs and grounding them. (messy.)
Eric was this a simulation or actual hardware ?
hi C,
Bit more checking of your STRVEN basic.
Every time you get a POSCNT to CAP2BUF match interrupt you are switching the QEB pin [PORTA.4] Low/High.??? why?
Code:On High Interrupt Save System 'interrupt on INDEX pulse PORTC.4 input. pir3.ic2qeif = 0 'clr in s/w, poscnt=maxcnt or indx PORTA.4 = 0 ''Hserout "Ix=", #azimval, " ", #poscnt, CrLf PORTA.4 = 1 pie3.ic2qeie = 1 'qei intr enb Resume
Also why are you switching PORTC.5.?
Code:If poscnt < azimval Then If azimval - poscnt >= 1800 Then PORTC.5 = 1 'rev passes thru 000 > 3599 index Else PORTC.5 = 0 Endif Gosub pwm_cont Goto get_count 'keep reading cap2buf [poscnt] Endif
Also what is 'forn' and 'revn' for, I thought you had agreed to hardware the transistors on the HBridge.?
Code:If PORTC.5 = 0 Then 'FWD PWM revn = 0 '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. ASM: bcf CCP2CON,DC2B0 ASM: bcf CCP2CON,DC2B1 ASM: movlw 0x00 ASM: movwf CCPR2L PWMduty 1, duty1 forn = 1 '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. Endif
Eric
Hi C. Does your FTDI have a strap or pad option for 5v / 3.3 v operation ? G ...
Not the same PIC, not the same language, similar problem... 2 joined UART 's need a power up sequence ..
https://www.eevblog.com/forum/microcontrollers/help-with-uart-in-pic18f4431/
hi C,
I was using a USB/UART converter which I recently bought from China, I could get data from the PIC 18F2431 to PC OK, but not from PC to PIC.
The data to the PIC input from the converter appeared corrupted in some way.
So I reverted back to my MAX232 for the UART comms, it works as before without any problems, see attached print out.
Attached is known working copy of the Test program for the 18F2431 comms, use it to test your prommer and PIC's.
Let me know your results.
Eric
NOTE:
I have used a different bin to ascii conversion subr in place of the '#' prefix, it makes the print out easier to read.
You can change the poscnt=0 in program listing, if you wish to test for different start up headings.
There is NO PWM drive output, its internally counting
Well I can only assume , guess, conclude, the PICs have a different revision level are you able to check this via PK3 2 pics have the same code ?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?