AvionicsMaster1
- 16th March 2013, 15:22
Ladies and Gents,
I'm playing with Proteus and serial outputs on a 12F683 using GPIO.5 as my output to the serial display. When I use this code
clear
trisio = %001000
gpio = 0
INCLUDE "modedefs.bas"
DEFINE CHAR_PACING 1000
define osc4
osccon = %01101110 ' sets int osc to 4 mhz
ansel = 0 ' all ports digital
cmcon0 = 7 ' comparators off
adcon0 = 0 ' adc off
b var byte
c var byte
y var byte
pinout var gpio.5
beginning:
let b = 0
let c = 0
for b = 0 to 15
'serout gpio.5,n9600,[10,13,13]
' pause 500
serout gpio.5,n9600,["b=",#b," c=",#c,10,13,13]
' pause 500
y = y + 1
serout gpio.5,n9600,["number of trips ",#y,10,13,13]
if b < 8 then
gpio = b
else
c = b + 8
gpio = c
endif
pause 500
next b
goto beginning I get what I expect. That is LEDs hooked up to a 74154(?) BCD to 16 decoder counting from 0 to 15 and serial out to a display that can be read by humans.
However, when I try to go to 8MHZ internal oscillator using this change
define osc8
osccon = %01111110 ' sets int osc to 4 mhz the LEDs count like expected but the serial out goes into Alien script mode.
I haven't tried using another output pin as I'm unsure if that's the problem.
Now the $64 question: Is there something special about GPIO.5 that needs to be accounted for to get serial out on that pin?
Let the schooling begin!
I'm playing with Proteus and serial outputs on a 12F683 using GPIO.5 as my output to the serial display. When I use this code
clear
trisio = %001000
gpio = 0
INCLUDE "modedefs.bas"
DEFINE CHAR_PACING 1000
define osc4
osccon = %01101110 ' sets int osc to 4 mhz
ansel = 0 ' all ports digital
cmcon0 = 7 ' comparators off
adcon0 = 0 ' adc off
b var byte
c var byte
y var byte
pinout var gpio.5
beginning:
let b = 0
let c = 0
for b = 0 to 15
'serout gpio.5,n9600,[10,13,13]
' pause 500
serout gpio.5,n9600,["b=",#b," c=",#c,10,13,13]
' pause 500
y = y + 1
serout gpio.5,n9600,["number of trips ",#y,10,13,13]
if b < 8 then
gpio = b
else
c = b + 8
gpio = c
endif
pause 500
next b
goto beginning I get what I expect. That is LEDs hooked up to a 74154(?) BCD to 16 decoder counting from 0 to 15 and serial out to a display that can be read by humans.
However, when I try to go to 8MHZ internal oscillator using this change
define osc8
osccon = %01111110 ' sets int osc to 4 mhz the LEDs count like expected but the serial out goes into Alien script mode.
I haven't tried using another output pin as I'm unsure if that's the problem.
Now the $64 question: Is there something special about GPIO.5 that needs to be accounted for to get serial out on that pin?
Let the schooling begin!