Open PeterHouseJr opened 1 week ago
Can you try modifying your avrdude.conf file and invert the reset pin there, by adding a ~
in front of the reset pin number?
Thank you for the quick response!
I copied the avrdude.conf file from the installation folder and placed it in the current folder and added the -C parameter to use the local conf file and modified the conf as you suggested only using my pin ~26 and removed pin 26 from the command line where the port is specified: command = 'sudo avrdude -n -p m328pb -C avrdude.conf -P /dev/spidev0.0:/dev/gpiochip0 -c linuxspi -B 12kHz'
programmer # linuxspi id = "linuxspi"; desc = "Use Linux SPI device in /dev/spidev*"; type = "linuxspi"; prog_modes = PM_TPI | PM_ISP; connection_type = spi; reset = ~26; # Pi GPIO number - this is J8:22 ;
The reset line is now inverted but still no MISO data.
Detail of One Reset Pulse
I have verified the voltage levels at the Target connector and all look good at the Target to Me. Tried multiple Targets and Not sure now why it does not work.
Any more ideas?
Strange issue.
What about other avrdude official release versions? Say avrdude 7.3 and avrdude 7.2.
I have no issues using LinuxSPI with my Raspberry Pi 400 and ATmega328P.
I tend to susepct there is a timing issue here.
My Python App Turns on the power, turns on the 3.3v-5v level shifter, waits 100ms, call AVRDUDE, turns off level shifter, turns off power.
As shown in the scope shot:
Observations:
I will try (when I get in the office on Monday):
I am hoping someone can look at this and either know this is correct signaling for the 328PB or know it is incorrect and tell me what it should be.
Thank you for everyone who has helped so far.
Still having issues . . .
These two scope shots show the working Pi using avrdude 6.3. The first four bytes are the same: 0xAC 0x53, 0x00, 0x00 with the 328 returning 0xFF 0xFF 0x53 0x00 as shown in the second scope shot.
Zoom in scope shot showing first four bytes:
The Reset line should be low during the communication which I initially thought was wrong.
I do keep getting errors from AVRDUDE. but they seem innocuous or incorrect. For instance, the speed issue does not make sense to me.
`Try without specifying -B :sudo ./avrdude_80 -v -n -p m328pb -C ./avrdude_80.conf -c linuxspi -P /dev/spidev0.0:/dev/gpiochip0 -U signature:r:TmpHex/sig.hex:i
Avrdude_80 version 8.0-20241010 (0b92721a) Copyright see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is /home/Peter/SDProg/avrdude_80.conf User configuration file /root/.avrduderc does not exist Warning: system wide configuration file version (@AVRDUDE_FULL_VERSION@) does not match Avrdude build version (8.0-20241010 (0b92721a))
Using port : /dev/spidev0.0:/dev/gpiochip0 Using programmer : linuxspi Defaulting bit clock to 200 kHz AVR part : ATmega328PB Programming modes : SPM, ISP, HVPP, debugWIRE Programmer type : linuxspi Description : Use Linux SPI device in /dev/spidev* Error: AVR device not responding Error: initialization failed (rc = -2)
Avrdude_80 done. Thank you. ` I have tried four -B options: 1kHz, 10kHz, 100kHz and no -B resulting in 6kHz, 10kHz, 100kHz and 166kHz respectively with the same error message. With no -B shows 200kHz as defult but the actual rate is 166kHz. The working unit runs at about 140kHz for comparison.
I copied the .conf file and the executable to my local directory in order to have the ability to change versions of avrdude for testing. I am working on getting avrdude 6.3 installed now alongside avrdude 8.0.
The exact same hardware works on another Pi running a previous version of Raspbian and avrdude 6.3 and run from a python script with a gui.
When I run the avrdude 6.3 executable, I get the following error: "bash: ./avrdude_63: cannot execute: required file not found". Probably since it is not installed and is missing libraries. Can two versions be installed at one time? Where can I get the 6.3 installer or source for compile? .github only goes back to 7 and I don't see v6.3 anywhere.
Any suggestions appreciated ! ! !
My Python App Turns on the power, turns on the 3.3v-5v level shifter, waits 100ms, call AVRDUDE, turns off level shifter, turns off power:
Sends this command using subprocess: command = 'sudo avrdude -n -p m328pb -c linuxspi -P /dev/spidev0.0:/dev/gpiochip0:26 -B 12kHz'
This command returns this to stderr: Error: AVR device not responding Error: initialization failed (rc = -2)
Here is the scope shot: The connections are shown on the scope screen. The Reset line is mostly low with a lot of high pulses. Immediately BEFORE each reset pulse are four bytes, 0xAC 0x53 0x00 0x00, clocked out on MOSI.
Here is a close up of the four bytes and the first reset pulse. All reset pulses are preceded by the same four bytes.
You can see the reset line is mostly low (Active Reset).
A previous version, 6.3, of AVRDUDE worked fine on this hardware using this command: command = 'sudo avrdude -n -p atmega328pb -C avrdude_gpio.conf -c linuxspi -P /dev/spidev0.0 -b 125000'
It works exactly the same whether a target is connected or not. The target is a mature product and programs correctly, with the same cable using an Atmel-ICE.
I believe the target is connected properly since I used this same hardware setup with AVRDUDE v6.3
The reset line seems to be inverted using AVRDUDE 8.0
Any help would be appreciated.