If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Damn, need the edit feature back . .
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
This works intermittedly...
HSEROUT [10,13," Increase Gain, ADCIN Value = ", DEC DC_Level_IN]
...about 4 times out of 10, I get a new line!
I've tried changing the baud
DEFINE HSER_BAUD 2400
...but I just get garbage when i do (yes, I'm changing the setting in the UART window too!). therefore I'm thinking this might the general flakiness of the internal oscillator &/or the quirkiness of the Microchip UART window?
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
In this order.
hserout [whatever data, 13,10]
this will work all the time as long as you have sufficient delay between all your HSEROUT, and as long as your baudrate is accurate.
What you want is a ANSI terminal, those who accept ESC character, like the boring Hyperterminal, TeraTerm, RealTerm to name only but those. With an ANSI terminal, you can clear the screen, change font color, background color etc etc etc ( see http://www.pbpgroup.com/modules/wfse...hp?articleid=9 for reference)
Unfortunately, PICKIT USART tool is not an ANSI one, so you have to deal with the pain or work around. If you're a bit familiar with Microsoft C#, you could modify Pickit USART tool (as it is open source anyways) to accept ESC characters, or to clear the screen when you receive, let's say, ASCII 225 or whatever else. That should be easy.
<hr>
I'll redo my explanation about USART tool debugging...
Unless your current hardware don't use Serial communication, there's no need to use a switch, no need for HSEROUT either. What you do is to sit your PICKIT on the regular programming pins (MCLR, PGD, PGC) all the time, then you use DEBUG/SEROUT/SEROUT2 on PGD I/O. For this you must use TRUE mode.
Clear enough now?
I may try to post an example before going to sleep.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Here's a quickie example.
Note: I cut the trace from the pot to RA0 on my board, soldered a wire to the pot output
circuit so I can connect the output from the pot to other A/D input pins.
This leaves RA0 free for serial debugging with the PICKit2 USART tool.
Code:@ device pic16F690, intrc_osc_noclkout, bod_off, wdt_off, mclr_off, protect_off DEFINE OSC 4 DEFINE DEBUG_REG PORTA DEFINE DEBUG_BIT 0 ' RA0 = TX out to PICKit2 programmer USART tool DEFINE DEBUG_BAUD 9600 DEFINE DEBUG_MODE 0 ' 1 = inverted, 0 = true DEFINE ADC_BITS 10 ' Set number of bits in result DEFINE ADC_CLOCK 1 ' Set clock source Fosc/8 "2uS" DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS Q CON 1251 ' For 10-bit A/D +Vref = 5V : 5V/1023*256=1.251=Quanta ADval VAR WORD Result VAR WORD OSCCON = %01100000 ' 4MHz internal osc ANSEL = %00000100 ' RA2 = A/D in, rest digital ANSELH = 0 ADCON0 = %10001001 ' Right justify, channel AN2, A/D enabled CM1CON0 = 0 CM2CON0 = 0 PORTA = %00000001 ' serial out pin idles high TRISA = %00000100 ' RA2 in, rest out Main: ADCIN 2,ADval Result = ADval */ Q DEBUG "Raw = ",DEC ADval," Real = ",DEC Result DIG 3,".",DEC3 Result," V",13,10 PAUSE 500 GOTO Main end
I'm hearing what your saying, but without an example to follow, I'm still left wondering how this is achieved.
To set out my stall again - programming is new to me - I'm more of an old analogue electronics type. I can relate to a switch! I took one look a the PICKIT2 UART Tool connectivity diagram....
& one look at the PICKIT2 schematic...
& saw that it only needed two pins switched...then I can simply go between programming mode & UART tool mode with the flick of a switch. In the absence of anything else meaningful 9to me at least), I followed up that path.
I can't believe just how much of a struggle it is for a newbie to get a 16F690 (probably the chip most newbies are exposed to as it comes with the PICKIT2) to do somethign as bland as send some stuff over a serial connection! (I don't mean about the h/w aspect, I mean getting the correct 'include' files & config, the register settings, the quirks about baud rates when using internal oscillators (as most newbies do)...then there's the h/w aspect .....what a lot of work!
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks