PDA

View Full Version : DT's INT's on 16F1936 an other stuff



MOUNTAIN747
- 17th April 2020, 19:49
trying to get going again after a couple of years doing other things. I have two questions.

1. I am transitioning my home projects from the 16F886 to the 16F1936. On the 886, DT’s Ints-14 requires wsave# system statements for four banks of memory. I have compiled the 1936 with DT’s INT using NO wsave systems statements without errors. The 16F1936 has 31 banks of memory. I haven’t tried the working hardware yet because I am skeptical that it is going to work only part of the time and I will spend hours to find out I need some kind of statements which are not present to avoid periodic errors. Has anyone used this PIC with DT’s Interrupts or any other PIC with 31 banks? Comments please!

2. why is my Serout2 statment working perfictly at 9600baud with a mode of 188 and not 84 at 8 Mhz. Mode 84 works great for 19200 baud. Never had this happen before.
Wayne

Ioannis
- 17th April 2020, 21:40
I Used in the past a 1939 one, and the first compilation had a message that I should add this:

wsave var byte $70 system

So, if you really need to add something, the compilation will give you the appropriate message.

Regarding the Serout thing, if you show us your code maybe we can give an explanation.

Ioannis

MOUNTAIN747
- 18th April 2020, 00:19
Thanks for the reply. So I feel better about the interrupts. Serout, ok.



asm
__config _CONFIG1,_FOSC_INTOSC & _CLKOUTEN_OFF & _MCLRE_ON & _BOREN_OFF & _WDTE_OFF & _FCMEN_OFF & _CP_OFF & _CPD_OFF & _IESO_OFF
__config _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_ON & _BORV_LO
endasm
define osc 8
OSCCON=%01110000 ;1110=8Mhz
ANSELA=0
ANSELB=0
ADCON0=0
PortA=0
PortB=0
PortC=0
TrisA=0
TrisB=0
TrisC=0

Start:
toggle LatA.1
pause 100
toggle LatA.1
serout2 USB_Tx,188, [" Hello USB World",13,10] 'working 188 at 9600baud on com15 @8Mhz
pause 3000
goto Start


At mode 84 I'm getting 19200baud. Beats me what is going on. Of course if its working fine, not a big deal.
Wayne

richard
- 18th April 2020, 00:27
there the problem
define osc 8
should be
define OSC 8

MOUNTAIN747
- 18th April 2020, 01:27
thanks Richard, I try that out. thats something I never thought about.
Wayne

MOUNTAIN747
- 18th April 2020, 17:33
Changing "osc" to "OSC" did the trick. Com now acting as it should.
Thanks.