Hi all, I hope you are well and healthy.

This little project is progressing really well, although not as quick as 
I'd like to have the time to... I got it all working and it's nice and 
smooth. However I do have a piece of code which I'm confused about and I 
was hoping that better trained eyes could help.

The code that I'm using (verbatim from here for now: 
http://www.cathodecorner.com/nwl/nwld1.asm.txt, that is helping me to learn 
PIC assembly so to write my own code later on) is doing analog conversion 
of outputs of the accelerometer ADXL335 (datasheet here 
https://www.analog.com/media/en/technical-documentation/data-sheets/ADXL335.pdf)
 
to sense motion / tilt of the wrist. It works beautifully and it's very 
reliable, coded by DF of Cathode Corner on the X-Y axis (he's also done it 
on Z-X on another project, so Z should work well on this sensor). My issue 
is that I have moved the chip such that I need to use Z-X instead of X-Y as 
in the code. Now that should be an easy code edit... Problem is that I can 
see the correct mV changes on X-Y-Z on the chip and all pins are 
individually well connected to the PIC but somehow the PIC ADC isn't 
picking up Z, so I'm thinking I'm doing something wrong with the channel 
selection.

Schematic here, except pin 8 Z-ADXL which I have actually connected to pin 
21 RA4 of the PIC): http://www.cathodecorner.com/nwl/NWLD5schem.pdf

X-ADXL connected to AN1 -> So here I should select ADCON0 CH0=1 CH2=0 
Y-ADXL connected to AN0 -> So here should be ADCON0 CH=0 CH2=0 (X and Y 
seem switched in the code but given some logic later on, it's fine, no 
issues so far).
Z-ADXL connected to AN4 -> So here I should select ADCON0 CH0=0 CH2=1 (but 
when I do that... it doesn't work, I get 0 voltage sensed, odd) 
Voltage monitor (resistive divider) connected to AN5 -> now this is odd as 
I would have expected to select ADCON CH0=1 and CH2=1 but it works only 
with ADCON0 CH0=0 and CH2=1 (so this is confusing to me! I don't understand 
why this works only on channel 4 when it's actually connected to channel 5 
and portA is set as '00110011' (2 and 3 being outputs) with '00110011' 
(AN0, AN1, AN4, AN5 being analog inputs).

Am I missing the obvious elephant in the room? Relevant code below (full 
code in the link above). I'd appreciate if anyone has 5 mins to spare to 
look into this please.

Thank you,
Max


movlw   B'00110011'     ; PORTA bits 2,3 outputs [pin 19 RA2 and pin 20 RA3]
        movwf   TRISA

bsf     BSR,BSR1        ; point to high bank
        movlw   B'00110011'     ; AN0 of pin 17 connected to Y-ADXL, AN1 of 
pin18 connected to X-ADXL, AN4 of pin21 connected to Z-ADXL, AN5 are analog 
[I have connected to  pin 19 and pin 20 are digital outputs
        movwf   ANSELA

bsf     BSR,BSR0        ; point to high bank
        bsf     ADCON0,ADON     ; turn on the A/D converter module
        bcf     ADCON0,CHS0     ; select A/D channel 0 = X
        bcf     ADCON0,CHS1
bcf     ADCON0,CHS2
        nop                     ; wait one millisecond
        nop
        nop
        nop
        nop
        nop
        nop
        bsf     ADCON0,GO       ; Start first A/D conversion at 2 
milliseconds
        nop                     ; Wait for X conversion to complete
        bsf     ADCON0,CHS0     ; select A/D channel 1 = Y
bcf     ADCON0,CHS1
bcf     ADCON0,CHS2
        movfw   ADRESH          ; get X tilt from A/D
; lo RAM
        bcf     BSR,BSR0        ; point to low bank
        movwf   XTilt           ; save X tilt
; hi RAM
        bsf     BSR,BSR0        ; point to high bank
        bsf     ADCON0,GO       ; Start second A/D conversion
        nop                     ; Wait for Y conversion to complete
bsf     ADCON0,CHS0
bsf     ADCON0,CHS1
        bcf     ADCON0,CHS2     ; select A/D channel 3 = Z
        movfw   ADRESH          ; get Y tilt from A/D
; lo RAM
        bcf     BSR,BSR0        ; point to low bank
        movwf   YTilt           ; save Y tilt
; hi RAM
        bsf     BSR,BSR0        ; point to high bank
bsf     ADCON0,ADON
; can remove the line above
        bsf     ADCON0,GO       ; Start third A/D conversion
        nop                     ; Wait for Z conversion to complete 
nop
nop
nop
btfsc ADCON0, GO
GOTO $-1
bcf     ADCON0,CHS0
        bcf     ADCON0,CHS1
bsf     ADCON0,CHS2     ; select A/D channel 4 = Volts
        movfw   ADRESH          ; get Z tilt from A/D
nop
nop
nop
; lo RAM
        bcf     BSR,BSR0        ; point to low bank
        movwf   ZTilt           ; save Z tilt
; hi RAM
        bsf     BSR,BSR0        ; point to high bank
        bsf     ADCON0,GO       ; Start fourth A/D conversion
        nop                     ; Wait for V conversion to complete
        nop                     ; Wait for V conversion to complete
        movfw   ADRESH          ; get volts from A/D
        bcf     ADCON0,ADON     ; turn off the A/D converter module



Il giorno sabato 19 settembre 2020 alle 18:10:06 UTC+1 Max DN ha scritto:

> gregebert, I finally managed to find some time to hand solder an LFCSP_LQ 
> package. Achievement :)
>
> What worked for me, it is easy and reliable: clean pins of chip with 
> alcohol, apply no-clean flux, apply normal soldering wire on the tip of the 
> iron (I think melting point 215-220 celcius), slide the tip of the iron on 
> all pins and center pads, clean PCB, apply flux, apply soldering paste 
> (eutectic point at 217 Celcius) on the PCB, align the pins of the chip to 
> the footprint on the PCB, hot air (max 230C), being careful not to heat the 
> chip too fast) and done. It takes just about 2 minutes to do it all.
>
> Hot air reflow alone wouldn't work as it's not guaranteed that the 
> soldering paste would stick to the tiny pins (no matter how clean) and 
> there is close to no chance to be able to inspect the bonds properly.
>
> I thought I'd share. 
>
> Best,
> Max
>
> Il giorno giovedì 10 settembre 2020 alle 21:50:21 UTC+1 Max DN ha scritto:
>
>> Hello, indeed I have. Two chips gone (oops), I have 10, I'm sure I'll 
>> learn before I get to the last one :)
>>
>> It amazed me that I managed to hand solder with hot air flow and 
>> soldering liquid paste a QFN40 first time with no issues, the LFCSP_LQ is 
>> obviously a different story. I tried to put less solder on the big center 
>> pad and all pins seem to be touching well, perhaps I burnt it but I was 
>> careful with the heating profile on the way up to the peak as well as down 
>> and how many seconds I spent on each phase.
>>
>>  But hey! Who doesn't like a good challenge on it after a long day at 
>> work! I'll get there.
>>
>> Il giorno giovedì 10 settembre 2020 alle 00:50:22 UTC+1 gregebert ha 
>> scritto:
>>
>>> Have you tried using solder paste and hot-air reflow ?
>>>
>>> On Wednesday, September 9, 2020 at 3:07:35 PM UTC-7 flata...@gmail.com 
>>> wrote:
>>>
>>>> David and all,
>>>>
>>>> Just a quick update. I finally had some time to remove all cables and 
>>>> to solder everything directly, with the nixies being on sockets and I'm 
>>>> pleased to report that it all works great! 
>>>>
>>>> Re: accelerometer ADXL335. I cannot get to solder that chip properly, 
>>>> quite tricky even under the microscope. I'll start again but I'm not too 
>>>> concerned about it, maybe I'll replace it with a chip in a different 
>>>> package, I find the LFCSP_LQ too tricky to hand solder even when following 
>>>> the recommended soldering profile.
>>>>
>>>> Re: HV 1308B - Turns out that the PCB layout that I posted here - while 
>>>> not ideal - works ok (ok-ish?) or at least it's not a disaster.
>>>>
>>>> I've added some tiny LEDs along the anode lines and they work great but 
>>>> they want a 1k resistor in series otherwise the tubes glow a bit blue, so 
>>>> I 
>>>> need to work around that.
>>>>
>>>> Next I'll look to add a photodiode to control brightness through PWM I 
>>>> suppose, the intention being to save power more than to dim the tubes. But 
>>>> I have some PIC assembly to chew first for PWM and perhaps I'll add touch 
>>>> buttons too...
>>>>
>>>> Nothing new for this group, but a whole new world for me. Feeling like 
>>>> I've been missing out!
>>>>
>>>> Thanks again for the suggestions given,
>>>>
>>>> Max
>>>> Il giorno lunedì 31 agosto 2020 alle 20:11:55 UTC+1 Max DN ha scritto:
>>>>
>>>>> Now this is an honour! David Forbes himself! I'm a big fan.
>>>>>
>>>>> David, thanks for taking the time to reply in detail. I have been 
>>>>> studying your circuit for 2-3 months now (I know, for most people here it 
>>>>> may take a day or so, but my knowledge of electronics is very basic 
>>>>> however 
>>>>> it's always been a passion of mine). My day job is in a totally different 
>>>>> field (banking) and since Covid lockdown started in the UK I have 
>>>>> dedicated 
>>>>> some of my spare time to this project, just as a way to switch off, so to 
>>>>> speak :-)
>>>>>
>>>>> My wife insists I should just buy your watch but I like a good 
>>>>> challenge (more so I'd like to try to make a HVPS at least as efficient 
>>>>> as 
>>>>> the Kopriso but that's some time away for my basic knowledge). I may 
>>>>> still 
>>>>> get your Cathode Corner watch as a courtesy for sharing your entire 
>>>>> firmware and schematics. Beside, I like it as well and perhaps start from 
>>>>> there and try to update the software to add functionalities (such as date 
>>>>> etc). I'd also like to improve the efficiency of the high voltage circuit 
>>>>> and have worked on 2-3 projects in parallel, but I'm leaving those in 
>>>>> standby for now given my limited spare time.
>>>>>
>>>>> I do think my issues are the amount of cables currently running to the 
>>>>> Nixies as well as poor layout. And perhaps many more. In fact, I'm still 
>>>>> surprised that it works at all, although not perfect (the accelerometer 
>>>>> is 
>>>>> not working at all or not working well, I'll look into that later, 
>>>>> probably 
>>>>> due to poor manual soldering skills there). 
>>>>>
>>>>> I have noticed that if I even try to just measure the voltage on the 
>>>>> feedback pin (I only get 1.17V or so) the brightness of the Nixies 
>>>>> changes. 
>>>>>
>>>>> The multiplexing doesn't work well with my current set up and you can 
>>>>> clearly tell it's there. I have taken a video if you are curious at all. 
>>>>> I'm loving this project and would like to keep the watch size of 
>>>>> 38mmx38mmx16.5mm which I think is achievable.
>>>>>
>>>>> Needless to say, David, your PC board design is compact and neat, my 
>>>>> first mistake was to have the feedback line running across the entire 
>>>>> board 
>>>>> as well as the switching pin so far from the transformer and with its 
>>>>> copper wire running under the 1308B! Oops.
>>>>>
>>>>> Last, it's a puzzle for me that a (random) 2.2k resistor in series 
>>>>> with the VCLAMP line seems to improve stability. And works better with 
>>>>> 3.2k. It's probably affecting the resistive divider somehow.
>>>>>
>>>>> I think you are spot on with all of your suggestions (of course). I'll 
>>>>> focus on the feedback line for now and perhaps just start from scratch 
>>>>> soon 
>>>>> by redesigning the high voltage layout.
>>>>>
>>>>> Thanks so much again.
>>>>>
>>>>> Massimo
>>>>> Il giorno lunedì 31 agosto 2020 alle 19:13:26 UTC+1 nixiebunny ha 
>>>>> scritto:
>>>>>
>>>>>> Massimo, 
>>>>>>
>>>>>> Hi. I see that you are trying to make the Cathode Corner Nixie watch 
>>>>>> circuit work, using your own circuit board design. it's not an easy 
>>>>>> circuit to build, because the design was optimized for size and 
>>>>>> efficiency, given the parts I had available. 
>>>>>>
>>>>>> The power supply is designed to make 180V with no load. It is 
>>>>>> designed 
>>>>>> to make about 10mA of current with one Nixie tube lit, where the 
>>>>>> Nixie 
>>>>>> tube regulates the voltage to about 150V. There is a third voltage 
>>>>>> level that is selected by the TiltP signal, which reduces the HV to 
>>>>>> about 90V by changing the feedback divider current, through that 33K 
>>>>>> resistor. This is done to provide blanking for the tubes while the 
>>>>>> power supply is active, which makes the multiplexing cleaner. 
>>>>>>
>>>>>> You can see that all of these parts interact, and the feedback 
>>>>>> resistor values were tuned after building a few watches, to get the 
>>>>>> display to look the best. I wouldn't have made it this way if I was 
>>>>>> only building one watch! 
>>>>>>
>>>>>> The clamp voltage is not critical, since the clamp Zener diode is 
>>>>>> only 
>>>>>> conducting when high voltage is on yet no tube cathode is enabled. 
>>>>>>
>>>>>> The circuit board layout is critical. I do not think that it will 
>>>>>> work 
>>>>>> properly if you have any length of cable on the Nixie tubes. This is 
>>>>>> because the capacitance of that cable, combined with the high votlage 
>>>>>> switching of mutliplexing, will generate noise and affect the timing 
>>>>>> of the cathode turn-on and turn-off. 
>>>>>>
>>>>>> Here's a picture of the PC board design for the round watch power 
>>>>>> supply. You can see that I made all the high current 3V power and 
>>>>>> ground traces very short and wide, to prevent problems with the 
>>>>>> switching currents radiating into the feedback circuit. In fact, my 
>>>>>> first prototype PC board had the feedback line running across the 
>>>>>> power supply, and it failed, so I had to add a wire to move that 
>>>>>> sensitive line away from the noisy switching circuit. 
>>>>>>
>>>>>> I hope that this description helps you to understand where to focus 
>>>>>> your attentions. 
>>>>>>
>>>>>>
>>>>>> On 8/31/20, Massimo Di Noi <flata...@gmail.com> wrote: 
>>>>>> > Hi all, 
>>>>>> > 
>>>>>> > I'm been following this group for a while and finally decided to go 
>>>>>> back to 
>>>>>> > 
>>>>>> > a hoppy that I had 15-20yrs ago or so, to brush up my old knowledge 
>>>>>> and to 
>>>>>> > build my personal nixie watch starting from what David at Cathode 
>>>>>> Corner 
>>>>>> > kindly shared, but looking to improve its efficiency with new chips 
>>>>>> and to 
>>>>>> > add functionalities similarly to Kopriso watch or else. I like the 
>>>>>> > capacitive buttons etc. 
>>>>>> > 
>>>>>>
>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"neonixie-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neonixie-l+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/neonixie-l/7312f712-37ed-40c5-a211-0b5233de9675n%40googlegroups.com.

Reply via email to