|
|
View previous topic :: View next topic |
Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Mon Jul 31, 2017 2:31 pm |
|
|
Good.
I have to agree with Temtronic on this. It's so pointless not to have a few of these adapters in stock. I also keep a couple of serial LCD's for the same reason.
I use the boards rather than cables:
<http://www.ebay.co.uk/itm/CH340G-RS232-Upgrade-To-USB-TTL-Auto-Converter-Adapter-STC-Brush-Module/252424791118?_trksid=p2047675.c100005.m1851&_trkparms=aid%3D555018%26algo%3DPL.SIM%26ao%3D2%26asc%3D20140122125356%26meid%3D3ac58bba8c2b4630a24d9914f065cb96%26pid%3D100005%26rk%3D3%26rkt%3D6%26sd%3D252461894405>
These are great since they operate on 3.3v or 5v, and at under £1 each in the UK (including delivery!), you can't even buy half the parts for the price!...
Great thing is that while for full I/O a proper UART is best, for simple 'got here' messages, a software UART on the PIC is easy to send debug messages, and a simple 5pin socket on the board, or a line on a plug in breadboard, makes connection quick... . You only actually need just one pin on the PIC to send this type of message. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Aug 04, 2017 3:39 pm |
|
|
Regarding the Vref+ bug in set_adc_channel() for the 16F914, 16F917, and 16F946, which was discussed earlier in this thread:
CCS emailed me and said it will be fixed in the next release, vs. 5.075. |
|
|
[email protected]
Joined: 05 Jan 2011 Posts: 5 Location: United States
|
ADC does not work with external reference |
Posted: Mon Aug 07, 2017 11:25 am |
|
|
I'm compiling for the 18F87J50 and using an external Vref for the 1st time.
My CCS version is 4,3,0,332
The Vref don't work. It appears to be turned off by set_adc_channel(0);
Failing code:
...
setup_adc_ports(san0 | san1 | san2 | san4, vss_vref);
set_adc_channel(0);
...
A look at the .LST file shows:
... set_adc_channel(0);
00234: MOVLW 00
00236: MOVWF 01
00238: MOVF FC2,W
0023A: ANDLW 83 // My comnt: Anding 0x80 turns off bit6 and bit6 allows the external Vref
0023C: IORWF 01,W
0023E: MOVWF FC2
...
The problem goes away when I code this:
...
setup_adc_ports(san0 | san1 | san2 | san4, vss_vref);
set_adc_channel(0);
setup_adc_ports(san0 | san1 | san2 | san4, vss_vref);
...
The second setup restores ADCON0 bit6.
This appears to be a compiler bug. Should AND the ADCON0 with 0xC0.
Bob |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Aug 07, 2017 11:41 am |
|
|
You have CCS vs. 4.xxxx. I tested it with vs. 5.071, and it's fixed by
that time. The 0xC3 mask shown below is correct:
Code: |
.................... set_adc_channel(0);
0003C: MOVLW 00
0003E: MOVWF @01
00040: MOVF ANCON1,W
00042: ANDLW C3
00044: IORWF @01,W
00046: MOVWF ANCON1
.................... |
CCS won't offer a patch to an old version. |
|
|
[email protected]
Joined: 05 Jan 2011 Posts: 5 Location: United States
|
|
Posted: Mon Aug 07, 2017 12:24 pm |
|
|
Thanks PCM Programmer. Yes, I understand that I have an old version.
Bob |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|